1. Exec <$ home/CSV/rushid.csv
Read line
Rushid = $ line
Exec is a pipeline command, which is generally not used separately.
Read from the CSV file and assign each line to line
Read is used to accept keyboard input in shell.
Line is a variable that accepts output parameters.
Ii. Cat commands
1) You can combine a sub-chapter file into a complete file.
$ Cat chap1 chap2 chap3> user_guide
User_guide if the original file is not empty, the text will be overwritten
2) You can use the cat command and I/O redirection (>) function to append the content of the second file to the first file cat file2> file1
3) Note: if you use the following command to merge files, the data content of file1 will be cleared, and only the data content of file2 will be copied to file1. Cat file1 file2> file1
3.
Sed-I's/$/& ', $ {rushid}'/G' $ home/CSV/rush_goodsid.csv
Sed is a text replacement command, just like substr_replace in PHP.
Sed-I indicates that if the file is modified without adding-I, the file is only displayed on the screen, and the file itself remains unchanged.
''Double quotation marks are in the format
S indicates search, and s indicates match in sed.
$ Indicates the end of the line ^ indicates the beginning of the line, and PHP also has a exhausting Regular Expression
& ', $ {Rushid}' is the value of the variable $ {rushid} appended to the end of the row.
/G indicates that all the global files are performing this operation.
Without/g, the variable value is added only at the end of the first line.
The final part is the target file.