【发布时间】:2017-03-26 01:52:19
【问题描述】:
文件夹中有一个名为pro1的程序和一个名为file1的数据文件。
在数据文件中,
Alex|New york karlos|011-1234-5678
Karl|Chicago koroq|012-3456-7890
Richard|New york ntown|023-4567-8990
我想使用 grep AND。
我写下了这段代码,但是没有用
for arg in $@; do
if[ count -eq 1]
then
egrep -i $arg file1 | $temp
else
egrep -i $arg $temp | $temp
fi
done
回声 $temp
当我输入“./pro1 Alex New york”时 我要打印 Alex|New york karlos|011-1234-5678
我该怎么做??
【问题讨论】:
标签: regex bash shell unix grep