Using the test shell builtin
It is probably time for us to pull over to the side of the scripting highway and look a little more at this command
test. This is both a shell builtin and a file executable in its own right. Of course, we will have to hit the built-in command first, unless we specify the full path to the file.
When the test command is run without any expressions to evaluate, then the test will return false. So, if we run the test as shown in the following command:
The exit status will be
1, even though no error output is shown. The
test command will always return either
1, respectively. The basic syntax of
Or, we can inverse the
test command with:
test ! EXPRESSION
If we need to include ...