Re: Bourn Shell Script While Loop Problems Solved.

2005-10-22 Thread Martin McCormick
Simo Kauppi writes: >Not sure if I understood the problem correctly, but how about: > >#! /bin/sh >filechop () { > #This function takes one file at a time and removes the bottom 6 lines. > #Get a single numerical value stating how many lines are in the file. > zlength=`wc -l $zonename|awk '{pri

Re: Bourn Shell Script While Loop Problems

2005-10-22 Thread Simo Kauppi
On Fri, Oct 21, 2005 at 08:45:38PM -0500, Martin McCormick wrote: > A Bourn shell script I am trying to run isn't behaving like I > expected it to and I am not sure how to make it play nice. There are > a bunch of DNS zone files that need the bottom 6 lines chopped off and > I hoped to do th

Re: Bourn Shell Script While Loop Problems

2005-10-21 Thread Marty
Marty wrote: zlength='wc -l $zonename|(read len fname; echo $len;)' Sorry, those single quotes should be backticks. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Re: Bourn Shell Script While Loop Problems

2005-10-21 Thread Marty
Martin McCormick wrote: "Roberto C. Sanchez" writes: Why not just use wc and sed? A good idea and also a good idea from Rick Pasotto <[EMAIL PROTECTED]> to use head -n -6. There is, however, a problem with that last suggestion in that the script is actually being run on a FreeBSD syst

Re: Bourn Shell Script While Loop Problems

2005-10-21 Thread Martin McCormick
"Roberto C. Sanchez" writes: >Why not just use wc and sed? A good idea and also a good idea from Rick Pasotto <[EMAIL PROTECTED]> to use head -n -6. There is, however, a problem with that last suggestion in that the script is actually being run on a FreeBSD system and FreeBSD's version of

Re: Bourn Shell Script While Loop Problems

2005-10-21 Thread Roberto C. Sanchez
On Fri, Oct 21, 2005 at 09:59:29PM -0400, Rick Pasotto wrote: > On Fri, Oct 21, 2005 at 09:57:13PM -0400, Roberto C. Sanchez wrote: > > On Fri, Oct 21, 2005 at 08:45:38PM -0500, Martin McCormick wrote: > > > A Bourn shell script I am trying to run isn't behaving like I > > > expected it to and I

Re: Bourn Shell Script While Loop Problems

2005-10-21 Thread Rick Pasotto
On Fri, Oct 21, 2005 at 09:57:13PM -0400, Roberto C. Sanchez wrote: > On Fri, Oct 21, 2005 at 08:45:38PM -0500, Martin McCormick wrote: > > A Bourn shell script I am trying to run isn't behaving like I > > expected it to and I am not sure how to make it play nice. There are > > a bunch of DNS

Re: Bourn Shell Script While Loop Problems

2005-10-21 Thread Roberto C. Sanchez
On Fri, Oct 21, 2005 at 08:45:38PM -0500, Martin McCormick wrote: > A Bourn shell script I am trying to run isn't behaving like I > expected it to and I am not sure how to make it play nice. There are > a bunch of DNS zone files that need the bottom 6 lines chopped off and > I hoped to do th

Bourn Shell Script While Loop Problems

2005-10-21 Thread Martin McCormick
A Bourn shell script I am trying to run isn't behaving like I expected it to and I am not sure how to make it play nice. There are a bunch of DNS zone files that need the bottom 6 lines chopped off and I hoped to do that with a while loop driven by the ls command. In order to loose the bo