The latest when looking at a shell data, according to the textbook, but the following error, can not run
As follows, the simple script:
#!/bin/bashcat | while Read Line do Echo $line Done < < (data.txt| awk'{print $}')
The following error occurred while running
sh while_test. SH while_test. SH 5: syntax error near unexpected token ' <'while_test. SH 5: ' Done < < (data.txt| awk'{print $}')'
And then run it in a single line without errors
while read line; Do echo $line; Done < < (cat data.txt| awk'{print $}')1234
After the online view, confirm no footstep error, no DOS file error. There is no good way out. Through multi-party verification. The original is Bash 3.0, the shell has added a new symbol "<<<" to get sub-tasks
The script is now changed as follows to run successfully:
#!/bin/bashcat | while Read Line do Echo $line done <<< 'cat data.txt| awk ' {print $} "'
Run successfully
sh while_test. SH 1 2 3 4
Shell appears syntax error near unexpected token ' < ' workaround