我有这条线:
S=`cut -d: -f4 | grep $name info.txt`;
然后我显示
echo "$S";
它什么都不显示。
grep $name info.txt
;` 给我输出:
Francis:8:98765432:commission // this is a line from my textfile separated by :
我正在尝试仅显示佣金
最佳答案
这也行
echo 'Francis:8:98765432:commission' | cut -d: -f4
关于linux - 带有命令行 grep 和拆分定界符的 ubuntu linux shell 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40396437/