sed
删除与输入数据匹配的行的命令有什么问题?
输入数据.txt
123,
1234,
1453,
Run Code Online (Sandbox Code Playgroud)
数据删除.txt
1234,hellofirstline
123,hellosecondline
14676,hellothirdline
1453,hellofourthline
Run Code Online (Sandbox Code Playgroud)
Datatodelete.txt 中的预期输出
14676,hellothirdline
Run Code Online (Sandbox Code Playgroud)
脚本:
echo "the script starts now"
while read EachLine
do
echo $EachLine
sed "/$EachLine/d" < /home/Datatodelete.txt >/home/dummy
done < /home/InputData.txt
Run Code Online (Sandbox Code Playgroud)