I have a really simple function in bash script that tells me the current directory. However it gives the error bash: =/home/users/abc: No such file or directory
$currentdir is empty.
Why is this happening? I also tried
$currentdir=`pwd`
and that didn't work too.
This is a similar question Bash: current directory variable and I tried this but it didn't solve my problem.
xpwd() {
$currentdir=$(pwd)
echo "current dir is $currentdir"
}