I need to parse the $PATH
environment variable in my application.
So I was wondering what escape characters would be valid in $PATH
.
I created a test directory called /bin:d
and created a test script called funny
inside it. It runs if I call it with an absolute path.
I just can't figure out how to escape :
in $PATH
I tried escaping the colon with \
and wrapping it into single '
and double "
quotes. But always when I run which funny
it can't find it.
I'm running CentOS 6.
which
?:
in the name to force people to type the pathname of the command as a full pathname. This could even be a legitimate ploy to make sure that sensitive commands are not booby-trapped (su
andsudo
spring to mind); the user who wants to execute them must either do gyrations withcd
or type the full pathname because the directory can't be on the path. (Of course, a symlink would get around that, so it isn't perfect protection.)PATH
,/usr/c:
would become/usr/c::
. Does anyone actually *need aPATH
which supports empty entries?