You are not logged in.
Pages: 1
null
Last edited by gromlok (2019-03-10 15:46:58)
.
Offline
http://pubs.opengroup.org/onlinepubs/96 … tag_03_266
http://pubs.opengroup.org/onlinepubs/96 … #tag_04_12
Two leading slashes, such as //foo, may be the odd one out depending on system.
http://en.wikipedia.org/wiki/Exit_status#Unix
http://pubs.opengroup.org/onlinepubs/96 … /wait.html
8 bit unsigned integer is 0-255.
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
null
Last edited by gromlok (2019-03-10 15:47:06)
.
Offline
If this script is bash only, you could use bash parameter expansion to get rid of any number of //:
$ DIR="/long//numerous//doubleslashed/path/to/"
$ FILE="file"
$ MYPATH="$DIR/$FILE"
$ cd $MYPATH
bash: cd: /long//numerous//doubleslashed/path/to//file: No such file or directory
$ cd ${MYPATH//\/\//\/}
bash: cd: /long/numerous/doubleslashed/path/to/file: No such file or directorySee http://mywiki.wooledge.org/BashGuide/Pa … _Expansion if you want a better explanation.
Edit: changed variable name from PATH to MYPATH. Boy was I surprised by bash: pacman: command not found
Last edited by alphaniner (2011-11-07 17:26:02)
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
Pages: 1