LISTSERV mailing list manager LISTSERV 16.0

Help for LINUX-L Archives


LINUX-L Archives

LINUX-L Archives


LINUX-L@LISTS.UFL.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Monospaced Font

LISTSERV Archives

LISTSERV Archives

LINUX-L Home

LINUX-L Home

LINUX-L  2007

LINUX-L 2007

Subject:

Re: help with simple script

From:

"[log in to unmask]" <[log in to unmask]>

Reply-To:

[log in to unmask]

Date:

Fri, 23 Feb 2007 14:49:15 -0500

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (64 lines)

Using the sed script below, I think this looping construct is what you want:

#!/bin/bash

#assumes that the script resides in your zone file directory
for file in `ls`
do
    sed -e '/^mx/d' < $file > "$file".new
done


Justin

Justin Moore
Systems Administrator
ProGifts, Inc.
3715-B NW 97th Blvd.
Gainesville, FL 32606
Phone: (352) 332-3833
Fax: (352) 332-8252
www.progifts.com



Clay Wells wrote:
> ok.. as for the looping. i'd try something like:
> #!/bin/bash
>
> dir=$1
>
> for file in `ls $dir`
> do
> # sed line(s) here
> echo $file
> done
>
>
>
>
>> On Friday 23 February 2007 11:24 am, Clay Wells wrote:
>>
>>
>>> sed -e '/^mx/d' < mxremove.txt > mxremoved.txt
>>>
>> Yes, except I don't want to remove both lines, just the mx<tab> line.
>>
>> However, I've solved that problem. I can change mx0 to ffff in all
>> files easily enough, temporarily, and change them back later. So this
>> works.
>>
>> However, it's the loop code that's driving me crazy.
>>
>> Help.
>>
>> Thanks.
>>
>> Jeff
>> --
>> Jeff Lasman, Nobaloney Internet Services
>> 1254 So Waterman Ave., Suite 50, San Bernardino, CA 92408
>> Our blists address used on lists is for list email only
>> Phone +1 909 266-9209, or see: "http://www.nobaloney.net/contactus.html"
>>
>>

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

2020
2019
2018
2017
2016
2015
2014
2013
2012
2011
2010
2009
2008
2007
2006
2005
2004
2003
2002
2001
2000
1999
1998
1997

ATOM RSS1 RSS2



LISTS.UFL.EDU

CataList Email List Search Powered by the LISTSERV Email List Manager