Answer by Hauke Laging for When are arbitrary strings passed to test ambiguous
> [ -f = -a -a -a ] bash: [: argument expected > [ -f = -a -a x ] But: [ x-f = x-a -a -a ] doesn't work either although [ -a ] is fine.
View ArticleWhen are arbitrary strings passed to test ambiguous
I came across this construct to test whether the shell variable $foo, which could contain any arbitrary string, matched foo: [ "x$foo" = "xfoo" ] The purpose of prefixing with x was never explained....
View Article
More Pages to Explore .....