So, what I'm trying to do is if the user didn't pass a path as argument to script, the script shall use the current directory. If a path is passed use it instead.
instdir="$(pwd)/"
if [ -n "$1" ] ; then
instdir="$1"
fi
cd $instdir
Errors
./script.sh /path/to/a\ folder/
outputs: cd: /path/to/a: File or folder not found
./script.sh "/path/to/a\ folder/"
outputs: cd: /path/to/a\: File or folder not found
What am I doing wrong here?