Try:
pwd=`pwd`
or
pwd=$(pwd)
Notice no spaces after the equals sign.
Also as Mr. Weiss points out; you don’t assign to $pwd
, you assign to pwd
.
More Related Contents:
- Input data to a shell script [closed]
- How to reload .bashrc settings without logging out and back in again?
- How do I iterate over a range of numbers defined by variables in Bash?
- Why would a correct shell script give a wrapped/truncated/corrupted error message? [duplicate]
- How to find the difference in days between two dates?
- Multi-dimensional arrays in Bash
- How do I check if a directory exists in a Bash shell script?
- Capture stdout and stderr into different variables
- How to determine the current interactive shell that I’m in (command-line)
- Associative arrays in Shell scripts
- How to get the part of a file after the first line that matches a regular expression
- Trying to split a string into two variables
- Open and write data to text file using Bash?
- Piping tail output though grep twice
- How do I echo stars (*) when reading password with `read`?
- Why is this bash prompt acting strangely/disappearing, and how do I fix it (OS X)?
- Why is “[[ 10 < 2 ]]" true when comparing numbers in bash? [duplicate]
- Bash: Copy named files recursively, preserving folder structure
- How to go to each directory and execute a command?
- Read a variable in bash with a default value
- Execute command containing quotes from shell variable [duplicate]
- What does “export” do in shell programming? [duplicate]
- What is the most elegant way to remove a path from the $PATH variable in Bash?
- pipe stdout and stderr to two different processes in shell script?
- Why equal to operator does not work if it is not surrounded by space?
- In bash, is there an equivalent of die “error msg”
- How can I convert tabs to spaces in every file of a directory?
- How to match a single quote in sed
- How to update one file in a zip archive
- How to read variables from file, with multiple variables per line?