Re: Script to strip lines from files



Kevin Collins <spamtotrash@xxxxxxxxxxxxxxxxxx> wrote in
news:slrndrr006.du0.spamtotrash@xxxxxxxxxxxxxxxxx:

> for file in *
> do
> lines="$(grep ^IP $file | tail -5)"
> echo "$lines" > $file
> done
>

Thanks. It works, but a parameter I forgot to add was that the files have
other information also that is not to be touched. The IP lines are at the
bottom of the file;


Name
Adress
Phone
(etc)
IP 1
IP 2
IP 2


Now it removes everything but the (5) IP lines.


CH
.