3 ms·
If I remember correctly the first conditionals in shell scripting were literally just calls to the program named "test" I believe or something like that They s
by wruza 4y ago
If I remember correctly the first conditionals in shell scripting were literally just calls to the program named "test" I believe or something like that
They still are, in a sense. [ is a synonym for test, and ] is a mandatory no-op argument to it, when used as a “built-in” syntax. You can use [ outside of if as well, like
[ <condition> ] && <then-action>
test <condition> && <then-action>
https://linux.die.net/man/1/test https://linux.die.net/man/1/test