1748219 Members
4686 Online
108759 Solutions
New Discussion юеВ

Re: nawk in HP UX 11

 
Gowrishankar_1
New Member

nawk in HP UX 11

Hi,
I see that there is no nawk command in HP UX 11. Our HP UX 10.2 Application uses nawk extensively in many script and we currently in the process of upgrading to HPUX 11. I want to know if I can just replace the nawks with the awk or is it going to lead me into trouble ?
Someone please help. Thanks in Advance.
-Gowrish

 

 

 

Moved from HP-UX Technical Documentation to HP-UX > languages

5 REPLIES 5
Slawomir Gora
Honored Contributor

Re: nawk in HP UX 11

Hi,

I think that better solution would be placing nawk in different directory ex: /opt/nawk
and correctly setting in your scripts PATH variable.
Leif Halvarsson_2
Honored Contributor

Re: nawk in HP UX 11

Hi,

The "new" (HP-UX 11) version of awk has replaced both awk and nawk in previous releeases. You will find all features from nawk in HP-UX 11 awk.
Prabu_3
Frequent Advisor

Re: nawk in HP UX 11

hi gowrishankar,
did u used awk instead of nawk on HP-UX 11. Was there any difference in their behaviour?. If so, let me know about it.

I am also using HP-UX 11(32 PA-RISC).
Victor Fridyev
Honored Contributor

Re: nawk in HP UX 11

Hi,

AFAIK, nawk and awk is the same in HPUX11.
If your scripts require nawk and you don't want or can't edit them, print:
ln -s /usr/bin/awk /usr/bin/nawk

HTH
Entities are not to be multiplied beyond necessity - RTFM
ulrichr
New Member

Re: nawk in HP UX 11

Hi,
this is not correct that in 11.23 awk replaces nawk:
If you try to use the followning command you see: it is not working under HP-UX awk,
but is working well with nawk under other OS

awk 'BEGIN { FS=":"; OFS=":" ; while ( getline < shadow > 0 ) shadow[$1] = $2 } /^[a-zA-Z0-9_]/ {$2 = shadow[$1] ; printf "%s\t%s\n", $1, $0 }' passwd