[also posted on stackoverflow at
http://stackoverflow.com/questions/11442539/how-to-keep-single-quotes-from-confusing-ksh-n
]
So I have a simple shell script:
$ cat try.sh
#! /bin/ksh
echo "'" | awk '
/'\''/ {
print "'\''ello, world"
}
'
and it runs fine:
$ ./try.sh
'ello, world
But "ksh -n" is not altogether happy with it:
$ ksh -n ./try.sh
./try.sh: warning: line 3: ' quote may be missing
./try.sh: warning: line 5: ' quote may be missing
I can use tricks (awk variables, awk hex sequences, etc.) to make this
go away, but surely there's some way to appease the syntax checker (if
nothing else, for the case when the embedded language has no provision
for workarounds). What am I forgetting?
Thanks,
Jeff
P.S. This is happening within a much more complex script and only
became an issue when I started using nmake to install the file-- nmake
is running "ksh -n" as part of its intrinsic ruleset.
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users