如果找不到匹配,则按grep返回新行

bio*_*ech 3 bash shell grep

如果grep找不到匹配项,我想修改此代码以返回空行:

while read vl ; do grep "^$vl" Table_S4.tab ; done < 1
Run Code Online (Sandbox Code Playgroud)

che*_*ner 10

while read vl; do
    grep "^$vl" Table_S4.tab || printf "\n"
done < 1
Run Code Online (Sandbox Code Playgroud)

如果grep找不到匹配项,printf将运行该命令并输出一个空行.