Possible memory leak in HPUX 7.0 csh - bizzare behavior

Len Jaffe hawkwind at cinnet.com
Thu Apr 4 09:42:17 AEST 1991


I have a wierd csh problem which manifested itself recently.

The script in question is supposed to parse its args so as to make
sure the TIME argument is in the correct format for the "at" 
command (it must contain a colon ':' due to some defect in HPUX 7.0).

The script ends up looping thru argv[] and sets argv[i] to 
"`echo argv[i] | sed 'put colon in time arg'`"
statement to put in the colon.  The script should then call a homegrown
command which in turn calls "at".  

If "$*" = "1501 /tmp/foo17264" then after the sed it looks like
"echo /tmp/foo17264".

I always thought that you could operate on csh's argv[] like it was 
any other variable.

The really odd part of all this is that the script works if I insert 
either of the following lines above the indexing loop. 

echo `date` $USER "$*"
#echo `date` $USER "$*"

This flaw seems dependent on the length of the extra line, because using

echo "$*"

alone won't make the script work.  I haven't spent the time to determine the
threshold length as I have better things to do with my time.

Why, oh why should a comment, yes a comment cause a shell script to
work, other than HPUX 7.0 csh having a memory leak?

Any clues would be greatly appreciated.

lenny.

-- 
Leonard A. Jaffe           hawkwind at cinnet.com
                           Cincinnati Public Access Un*x



More information about the Comp.unix.questions mailing list