I'm trying to write a script and in it I need to use a local variable that
I define and I need to set the value of this variable to the value of the
first line of a file.
I can get the first line of a file by typing:
head -1 filename
...and it outputs to my screen the first line of the file. But how do I
assign that output to the value of a variable?
I've tried things like:
head -1 filename > $variablename
set variablename < head -1 filename
I've also tried this:
export variablename=`head -1 filename`
...but I get a permission denied error and the man pages show nothing for
None of the above works. Any ideas? (BTW - we are running DG/UX on a Data
Any help is greatly appreciated! Thanks!
GERS Retail Systems
9725-C Scranton Road
San Diego, California 92121