awk -v issue in Sun Solaris


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users awk -v issue in Sun Solaris
# 1  
Old 03-05-2012
awk -v issue in Sun Solaris

Hi,
awk -v is having issue in sun solaris, however the same works fine in HP Superdome. Pls advise what to do, while executing below command in SunOS.

echo "this is saurabh"|awk -v a="SAURABH" '{ print a }'
# 2  
Old 03-05-2012
Use nawk.
# 3  
Old 03-05-2012
There should be no reason to use the legacy awk binary instead of nawk or /usr/xpg4/bin/awk, however, should you really want to do it, here is the syntax it expects:
Code:
echo "this is saurabh"|awk '{ print a }' a="SAURABH"

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Issue with awk command between Linux and Solaris

Hi, Here is the output using bash profile on Linux uptime 04:59:14 up 16 days, 4:48, 2 users, load average: 1.00, 1.00, 1.20 Here is the output using bash profile on Solaris uptime 4:00am up 84 day(s), 22:21, 3 users, load average: 0.09, 0.10, 0.12 Now,... (4 Replies)
Discussion started by: mohtashims
4 Replies

2. Solaris

Sun-Fire-V490 Printer Issue After Upgrade of Solaris

Hey Guys I am new here, dont know if any one can assist me with this issue. I have a Sun-Fire-V490 machine that was upgraded to version 9 and patched a few months back. Problem is a few network printers managed by the server is printing an extra page that comes out before and after every print... (0 Replies)
Discussion started by: mprogams
0 Replies

3. Shell Programming and Scripting

awk script Error in Sun Solaris

Hi Friends, the below script has been through the errors in sun solaris. awk '/%s/{f=0 ;n++; print >(file="OUT_" n); close("OUT_" n-1)} f{ print > file}; /%s/{f=1}' $BASE_DIR/concat.TXT awk: syntax error near line 1 awk: bailing out near line 1 And ls $MERGE_DIR/*.R | awk ' { ... (2 Replies)
Discussion started by: krbala1985
2 Replies

4. Solaris

Sun Solaris Coolstack issue

I have coolstack running on my solaris 10 server. Everytime I make a change to a php script I have to restart apache for the changes to take effect? Not sure if the issue is with apache or php or both? Does coolstack enable some type of caching that I am unaware of? I have disabled... (0 Replies)
Discussion started by: mrlayance
0 Replies

5. Solaris

useful links and help resources for Sun's products and Sun's Solaris

Hi all, Those links might help anyone Knowledge base Video tutorials (0 Replies)
Discussion started by: h@foorsa.biz
0 Replies

6. Solaris

Sun Fire 280R Sun Solaris CRT/Monitor requirements

I am new to Sun. I brought Sun Fire 280R to practice UNIX. What are the requirements for the monitor/CRT? Will it burn out old non-Sun CRTs? Does it need LCD monitor? Thanks. (3 Replies)
Discussion started by: bramptonmt
3 Replies

7. Solaris

Net-SNMP-5.4.2.1 issue on Sun Solaris

Hi, I am trying to compile the source code for Net-SNMP-5.4.2.1 using the gcc compiler-3.4.6 and 3.4.3 but I am getting the follwoing error with perl enabled: /bin/sh ../libtool --mode=link gcc -g -O2 -Usolaris2 -Dsolaris2=solaris2 -fno-strict-aliasing -pipe -Wdeclaration-after-statement... (2 Replies)
Discussion started by: tisha
2 Replies

8. UNIX for Dummies Questions & Answers

Sun Solaris 10: How do I create a bootup disc? The Sun website confuses me

Hey there, I am starting a Computer Science Foundation year at the end of this month and am trying to get a little bit ahead of the game. I have always wanted to learn Unix and am currently struggling with creating a boot disc to run Solaris (I have chosen to study this) from as opposed to... (0 Replies)
Discussion started by: Jupiter
0 Replies

9. Solaris

Sun Solaris Sun Java Desktop

Ok I a n00b, not gunna hide it so here goes - Sun Solaris, V.10 i386 - during the setup, I can choose a screen resolution that looks great with 65k colors and all. However, when all is said and done 4 disks and a reboot later, I get hanious 640x480 @ 256 only. If I choose the Sun Java Desktop... (20 Replies)
Discussion started by: Spooky
20 Replies
Login or Register to Ask a Question