Read is used to remove each line from a file for processing
Cat read. SH #!/bin/bashecho"using read"cat name.txt | while Read name Do Echo " name is $name " Done
For multiple to remove a file from a stack of files for processing
$Cat for.SH#!/bin/BashEcho "using for"I=0 for file inch*. txt DoEcho "file name is $file"I=`Expr$i +1` DoneEcho "we have $i files"
The case is used to process the shell script with different parameters after it
$Cat Case.SH#!/bin/BashEcho "using case" Case$1 inch-a)Echo "You are using-a";;-b)Echo "You are using-b";;*)Echo "You input was not correct, and please input-a or-b";;Esac
If more is used for various condition judgments, such as size, file existence etc.
$Cat if.SH#!/bin/BashEcho "using If"if[-F $1 ] ThenEcho "$ a regular file"elif[-D $1 ] ThenEcho "is a directory"fi
Note: Represents a parameter followed by a script
Read,for,case,while,if Simple Example