I have a #!/bin/sh script that has the following line:
if [ ! -x "$TEST_SLAPD" ]
$TEST_SLAPD
is the full path to a .bat file.
I am wondering what the -x
flag means in the context of that if
statement?
if
just checks for result of command following it. [
is not (at least not always) an operator, it's small utility called 'test'.
From its documentation:
-x file
True if file exists and is exe-
cutable. True indicates only
that the execute flag is on. If
file is a directory, true indi-
cates that file can be searched.
(and yes, !
is obviously negation)
For similar evualation flags, documentation is available here: http://illumos.org/man/1/test
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With