awk script Error in Sun Solaris


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting awk script Error in Sun Solaris
# 1  
Old 03-09-2011
MySQL awk script Error in Sun Solaris

Hi Friends,

the below script has been through the errors in sun solaris.

Code:
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

Code:
ls $MERGE_DIR/*.R | awk '
{
   sub("$MERGE_DIR/", "");
   sub(".R$", "");
   pre=post=$0;
   sub("[0-9]*$", "", pre);
   sub("^[A-Z]*", "", post);
   new=sprintf("%04d", ++P[pre]);
   if (new != post) system("mv $MERGE_DIR/" pre post ".R $MERGE_DIR/" pre new ".R")
}'
 
awk: syntax error near line 3
awk: illegal statement near line 3
awk: syntax error near line 4
awk: illegal statement near line 4
awk: syntax error near line 6
awk: illegal statement near line 6
awk: syntax error near line 7
awk: illegal statement near line 7

Moderator's Comments:
Mod Comment Please use code tags for command lines, source code, console output, ...
# 2  
Old 03-09-2011
Try gawk or nawk.
# 3  
Old 03-10-2011
Quote:
Originally Posted by Corona688
Try gawk or nawk.
Or /usr/xpg4/bin/awk
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Fsck: alignment error Solaris 8, SUN Netra AX11505

Hello all, I recently powered on my Netra AX1105 server only to be greeted with the following error message. I am not sure what to do here, I cant fun fsck on OK prompt.. did ok>boot -r and now it keeps booting from net, then I run ok>boot disk then outputs the following message... and keeps... (3 Replies)
Discussion started by: br1an
3 Replies

2. Solaris

write a script to execute some operations on sun solaris

Sun Microsystems Inc. SunOS 5.9 Generic May 2002 SUNFIRE V240 if there is a power failure, automatically: write all operations in a log file (0 Replies)
Discussion started by: doudou2012
0 Replies

3. UNIX for Advanced & Expert Users

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 Replies)
Discussion started by: sbaisakh
2 Replies

4. Shell Programming and Scripting

linux bash script to sun solaris

Hi guys, I seek a solution for this action for Sun solaris. find /sapmnt/${up}/global -prune -printf "%m %M %u %g %p\n" > $DAT1 The Application/Utilities in Sun Solaris are to old and cant understand "-printf". An update for Application/Utilities is exist, but not possible to implement... (6 Replies)
Discussion started by: ixibits
6 Replies

5. Programming

Sun Solaris C++ Compiling Error

Hello. I'm using SunStudio 12 Update 1. When compiling for x86, everything works fine. When compiling for SPARC, I get the following errors. I linked libCstd.so.1 explicitly, but I get the same errors. Would anyone be kind enough to step me through resolving this? Thank you very much. **... (2 Replies)
Discussion started by: acheong87
2 Replies

6. Shell Programming and Scripting

Script to login to attached SUN Storage through Solaris m/c w/o user intervention

I want to create a shell script to CLI login to attached SUN 6140 storage from Sun Solaris 9 m/c (instead of using CAM ) but that prompts me for password despite the fact that i am adding them in script .. i am using "expect" feature for this .. however as i never used "expect " before .. so... (0 Replies)
Discussion started by: yogesh29sharma
0 Replies

7. 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

8. Shell Programming and Scripting

How to write shell script in sun solaris ?

Hi , I am New to unix shell scripting. So can anybody help me. How to write shell script in sun solaris ? How to run/execute the script ? please post in details. (1 Reply)
Discussion started by: deb.simply
1 Replies

9. Solaris

sun solaris 10 make error

i am new to solaris 10 just installed the entire DVD i have the make and gmake installed in the right postions but even when logged in as root when i run make i get "a command not found " do i have to specify a sepecial path in solaris am trying to compile postfix for a mail server i have... (9 Replies)
Discussion started by: sunrise
9 Replies

10. Programming

CC LInker Error UNIX Sun Solaris

Hi Together, while compiling my program with CC I get the following Error message from the Linker: Undefined first referenced symbol in file std::basic_string<char,std::char_traits<char>,std::allocator<char>... (2 Replies)
Discussion started by: nik
2 Replies
Login or Register to Ask a Question