Quantcast
Channel: scriptdir=`dirname $0` not working - Super User
Browsing latest articles
Browse All 3 View Live

Answer by Ricky for scriptdir=`dirname $0` not working

dirname -- "$0"The -- (dash dash) stops dirname from processing any options in the argument. Always quote $0 in case there are spaces in the name.

View Article


Answer by Biapy for scriptdir=`dirname $0` not working

use quotes. It may fix your issue.scriptdir=`dirname -- "$0"`I personnaly prefer this notation in bash scripts, but it is not mandatory:scriptdir="$(command dirname -- "${0}")"EDIT:You may find the...

View Article

scriptdir=`dirname $0` not working

I am trying to get the directory where my script is in by using:scriptdir=`dirname $0`but this gives me the following error:dirname: invalid option -- 'b'Try `dirname --help' for more information.and I...

View Article
Browsing latest articles
Browse All 3 View Live