Re: Script to strip lines from files
- From: Christian Hansen <i.dont@xxxxxxxxxxx>
- Date: Thu, 05 Jan 2006 14:38:16 -0600
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
.
- Follow-Ups:
- Re: Script to strip lines from files
- From: Etienne Marais
- Re: Script to strip lines from files
- From: Kevin Collins
- Re: Script to strip lines from files
- From: Ed Morton
- Re: Script to strip lines from files
- References:
- Script to strip lines from files
- From: Christian Hansen
- Re: Script to strip lines from files
- From: Kevin Collins
- Script to strip lines from files
- Prev by Date: Re: Script to strip lines from files
- Next by Date: Re: Useful use of cat
- Previous by thread: Re: Script to strip lines from files
- Next by thread: Re: Script to strip lines from files
- Index(es):