I would like to extract the current path in a variable and use it later on in the script
myvar = pwd
But my bash skills have rusted over the years.
How would i go on about doing that?
myvar="$PWD" cd "$myvar"
(Quotes are necessary if your path contains whitespaces.)
Something like this should work:
myvar=`pwd` # ... cd $myvar