Shell/gawk interaction

Ralph Finch rfinch at caldwr.water.ca.gov
Fri Dec 14 09:21:04 AEST 1990


I do not understand why the following bourne shell script generates an
error in the awk program:

(call the script file test1)

#!/bin/sh
filename=$1 ; shift
nargs=$#  
args="$*"
echo $args

gawk '
BEGIN {
args="'$args'"
print args
exit 
}' $filename


(running the script file):

test1 abc 1 2 3
1 2 3
gawk:  syntax error near line 3:
args="1
     ^ unterminated string


-- 
Ralph Finch			916-445-0088
rfinch at water.ca.gov		...ucbvax!ucdavis!caldwr!rfinch
Any opinions expressed are my own; they do not represent the DWR



More information about the Comp.unix.questions mailing list