有没有办法在 grep 命令后添加回显?
例如,如果我运行这个:
grep -R $id && echo appearances in database
输出为
listofids.txt:226526658 201
appearances in database
有没有办法让它显示如下:
listofids.txt:226526658 201 appearances in database
我尝试了一些想到的想法,但没有任何效果,例如:
echo "" grep -R $id "appearances in database"
我知道这行不通,但我认为值得一试。
最佳答案
这应该做:
echo "$(grep -R $id) appearances in database"
关于linux - 在 grep 搜索后添加 echo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37101732/