Write Linux Shell script to display current working directory.
echo "The current working directory: $PWD"
echo "The previous current working directory: $OPLDPWD"
_cwd="$PWD"
## use pwd command ##
_mydir="$(pwd)"
## or ##
_mydir="`pwd`"
echo "My working dir: $_mydir"
Comments
Leave a comment