bash scripting

Michael O'Donnell mod+blu at std.com
Fri Sep 29 15:09:18 EDT 2000



>I came accros the following construct in a bash script:
>
>if [ ! -f /path_to_file_1 -a -f /path_to_file_2 ] ; then
>        execute some stuff
>fi
>
>My question is what is the -a option?


The -a option specifies "logical AND"

While running bash try invoking the builtin
"help" command (just to get a sense of what
bash is always standing by to help you with)
and then say "help [" so bash can remind
you that the "[" command is really just
an alias for the "test" command, and then
finally say "help test" and stand back -
all the possible options will go flying by,
including the "-a" one you inquired about...

-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).



More information about the Discuss mailing list