为什么在while循环中没有从文件中读取管道。以下方案的解决方法是什么?
$ while read -r cmd
$ do
$ echo $cmd
$ echo ----
$ $cmd
$ echo ---------------
$ done < commands
df -hT|awk -v OFS='\t\t\t\t' '{print $1,$2,$7}'
----
df: invalid option -- '|'
Try 'df --help' for more information.
---------------
df -h | wc -l
----
df: '|': No such file or directory
df: wc: No such file or directory
$ cat commands
df -hT|awk -v OFS='\t\t\t\t' '{print $1,$2,$7}'
df -h | wc -l