A simple awk script works fine in Linux and my own HPUX 11.31 platform, but it doesn't work in other HPUX 11.31 system. I can't access the problematic HPUX system so I am not able to test something for now.
@ Input data
mystring my.linuxsrc Running 16840
yourstring your.linuxsrc Running 41794
@ myawk.awk
/mystring / { printf "%s#%s#%s#%s",$1,$2,FIRST,$3; printf "\n"; flag="YES"}
@ Error in other HPUX system
syntax error The source line is 1
The error context is
<<< >>>
awk: Quitting
The source line is 1.
The version of awk in other HPUX system:
other_HPUX] what /usr/bin/awk
/usr/bin/awk:
main.c $Date: 2009/02/17 15:25:17 $Revision: r11.31/1 PATCH_11.31 (PHCO_36132)
run.c $Date: 2009/02/17 15:25:20 $Revision: r11.31/1 PATCH_11.31 (PHCO_36132)
$Revision: @(#) awk R11.31_BL2010_0503_1 PATCH_11.31 PHCO_40052
My HPUX system:
my_HPUX] what /usr/bin/awk
/usr/bin/awk:
main.c $Date: 2008/05/19 14:40:42 $Revision: r11.23/3 PATCH_11.23 (PHCO_38267)
lib.c $Date: 2007/02/23 16:15:06 $Revision: r11.23/2 PATCH_11.23 (PHCO_36053)
run.c $Date: 2008/05/19 14:40:53 $Revision: r11.23/1 PATCH_11.23 (PHCO_38267)
$Revision: @(#) awk R11.23_BL2008_0602_1 PATCH_11.23 PHCO_38267
Can you let me know why the simple awk fails in other HPUX system?
@ Resolution
The Awk script includes CRLF on Unix box, so there is a problem to use the file. After removing CR, it works fine.