I need delete lines with pattern similar, in multiple files (2500 .in files). example I have an input file -- "transmission-gtk.in" -- whose content is something like, but it is variable, I do not know:
#!/bin/sh
Popcon=18013
Section=main
Name='<b>Transmission</b>'
Comment='<span size="xx-large">Download and share files over BitTorrent</b>'
Name='<b>Start Transmission with All Torrents Paused</b>'
Name='<b>Start Transmission Minimized</b>'
Comment3=' '
License=' '
Screenshot=' '
In the above case "transmission-gtk.in" I need automatic delete:
Name='<b>Start Transmission with All Torrents Paused</b>'
Name='<b>Start Transmission Minimized</b>'
I have tried this, but it doesn't work in my case:
cd $HOME/My_files_in
PATH_WITH_SLASH=`sort *.in | uniq -D -w 10`
for i in $PATH_WITH_SLASH; do sed -i "\|$PATH_WITH_SLASH|d" $i ; done
The result said: "The argument list is too long"
sed
doesn't look right to me either. You're replacing insed -i ...
using the same variable that you're using for the source of dirs. in thefor i in ...
. What's going on there? – slm Mar 01 '14 at 02:07