Five, Shell Scripting combat high-level programming fifth

A conditional expression

     Various tests are usually performed in a variety of flow control structures bash, and then perform operations according to the different test results. Sometimes and if combined, allows us to easily judge.

    E.g:

1) determine whether a file exists: test -f file

2) the non-grammar test! -F file

3) determine non-empty: test -n "$ arg"

4) determine whether 0 test -z "$ arg" 

Guess you like

Origin www.cnblogs.com/dangjingwei/p/11610793.html