Shell Command Execution Sequence Control [plain] www.2cto.com & command 1 & command 2: If this command is successfully executed, execute this command. [Development]/usr/xxxx/ytcclb> ls-l test. SQL-rwxr -- r -- 1 xxxx group 225 Nov 15 test. SQL [development]/usr/xxxx/ytcclb> cp test. SQL test. bak & echo "coping file OK! "Coping file OK! [Development]/usr/xxxx/ytcclb> ls-l test. *-rwxr -- r -- 1 xxxx group 225 Nov 15 17: 48 test. bak-rwxr -- r -- 1 xxxx group 225 Nov 15 test. move the SQL file and delete the Directory: $ mv/apps/bin/apps/dev/bin & rm-r/apps/bin to sort the file and output it to another file, print: $ sort test. SQL> test. bak & lp test. bak | command 1 | command 2: If this command fails to be executed | then run this command. $ Cp test. SQL test. bak | echo "errors occured during coping file" For example: [development]/usr/xxxx/ytcclb> cp test. SQL test. bak [development]/usr/xxxx/ytcclb> ls-l test. *-rwxr -- r -- 1 xxxx group 225 Nov 15 test. bak-rwxr -- r -- 1 xxxx group 225 Nov 15 test. SQL [development]/usr/xxxx/ytcclb> chmod u-w test. bak [development]/usr/xxxx/ytcclb> ls-l test. *-r-xr -- r -- 1 xxxx group 225 Nov 15 18:08 test. bak-rwxr -- r -- 1 xxxx group 225 N Ov 15 test. SQL [development]/usr/xxxx/ytcclb> cp test. SQL test. bak | echo "errors occrued during coping file" cp: unable to create file test. bak: Permission denied (error 13) errors occrued during coping file [developer]/usr/xxxx/ytcclb> () and {}: combine several commands. (Command 1; command 2;...): execute a group of commands in the current shell. {Command 1; command 2;...}: The content in braces is executed as a whole.