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"
>>
>>
|