Hello,
I have 2 short scripts that suppose to display user defined variable NAME. Script1 works fine, but script2 gives the syntax error. The only difference is space in NAME variable.
I'm running this on dgux R4.20MU06 generic AViiON PentiumPro
#script1
NAME="firstlast"
echo test | awk '{print "'$NAME'" }'
#script2
NAME="first last"
echo test | awk '{print "'$NAME'" }'
script 2 gives the syntax error:
UX:awk: ERROR: syntax error at source line 1
UX:awk: INFO: Context is
{print >>> "first <<<
UX:awk: ERROR: Illegal statement at source line 1
UX:awk: ERROR: Missing }
Thanks a lot
I have 2 short scripts that suppose to display user defined variable NAME. Script1 works fine, but script2 gives the syntax error. The only difference is space in NAME variable.
I'm running this on dgux R4.20MU06 generic AViiON PentiumPro
#script1
NAME="firstlast"
echo test | awk '{print "'$NAME'" }'
#script2
NAME="first last"
echo test | awk '{print "'$NAME'" }'
script 2 gives the syntax error:
UX:awk: ERROR: syntax error at source line 1
UX:awk: INFO: Context is
{print >>> "first <<<
UX:awk: ERROR: Illegal statement at source line 1
UX:awk: ERROR: Missing }
Thanks a lot