Linux shell programming ---- Judge 1 test in shell to Judge 1 test-f $ file name to determine whether the file exists test-f $ file name. Example: Use the test-f command to find the input.txt file in the/homedrop folder, if exist is output, otherwise, no exist 2 is output, and there are many other commands: 1 test-d $. The directory name determines whether the directory exists. 2 test-r $ the file name determines whether the file has the read permission. 3 test-w $ the file name determines. whether the file has the write permission 4 test-x $ whether the file has the execution permission 2 [[Judge 1 must be separated by spaces in brackets, for example, ['10' <'20'] this judgment, it is better to have four spaces in the brackets. 2. Enclose the variables in double quotation marks. a = "this" B = "this is" for example, ["$ "! = "$ B"] 3 constant in brackets, it is best to enclose them in single quotes, for example, ['4' = '4'] 3 (the following is just an example of [], or test, only [] Looks beautiful) 1. Single Branch judgment structure if []; then statement fi 2 dual Branch judgment structure if []; then statement else statement fi 3 multi-branch judgment structure if []; then statement elif []; then statement else statement fi 4 case realize multi-branch judgment structure case $ Variable in condition 1) statement; condition 2) statement; Condition 3) statement ;;............................. *) statement; esac