awk problem (Solaris vs Linux)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting awk problem (Solaris vs Linux)
# 1  
Old 07-28-2010
Question awk problem (Solaris vs Linux)

My overall goal is to parse a large log by date range - here's my code:
Code:
awk '$0>="["from && $0<="["to' from="2010-07-24 13:00" to="2010-07-24 13:05:" my.log

This works fine with Linux but I get the following error with Solaris:
Code:
awk: syntax error near line 1
awk: bailing out near line 1

Is there a known workaround for this problem?

Last edited by Franklin52; 07-29-2010 at 03:46 AM.. Reason: Please use code tags!
# 2  
Old 07-28-2010
If your system is solaris, use /usr/bin/nawk or /usr/xpg4/bin/awk
This User Gave Thanks to rdcwayx For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 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. Shell Programming and Scripting

awk works on Linux but fails on Solaris

On linux i have the below command working fine. awk '/<app-deploy>/{A=1;++i} /<\/app-deploy>/{print >> "found"i".tmp";A=0} A{;print >> "found"i".tmp"}' deploy.xml But the same is failing on Solaris Output: awk: syntax error near line 1 awk: bailing out near line 1 uname -a SunOS mymac 5.10... (5 Replies)
Discussion started by: mohtashims
5 Replies

3. Programming

Linux/Solaris System Administrator to become a Linux/Solaris System Programmer?

Hi all What is the qualification required by Linux/Solaris System Administrator to become a Linux/Solaris System Programmer as to gain complete knowledge on computers. Thanks (1 Reply)
Discussion started by: Tlogine
1 Replies

4. Shell Programming and Scripting

awk problem - combining awk statements

i have a datafile that has several lines that look like this: 2,dataflow,Sun Mar 17 16:50:01 2013,1363539001,2990,excelsheet,660,mortar,660,4 using the following command: awk -F, '{$3=strftime("%a %b %d %T %Y,%s",$3)}1' OFS=, $DATAFILE | egrep -v "\-OLDISSUES," | ${AWK} "/${MONTH} ${DAY}... (7 Replies)
Discussion started by: SkySmart
7 Replies

5. UNIX for Advanced & Expert Users

Linux column(1) from util-linux-ng for Solaris? Which *.pkg to install?

Hi On Linux systems there is a command called "column". column - columnate lists Synopsis column -tx] -c columns] -s sep] file ...] Description The column utility formats its input into multiple columns. Rows are filled before columns. Input is taken from file operands, or,... (3 Replies)
Discussion started by: slashdotweenie
3 Replies

6. Solaris

Solaris 8 -> Solaris 10 = problem :/

Hello, I have a multithreading program (just two threads) which works on Solaris 8. I use pthread library to synchronize threads. I try to run it on Solaris 10 (on another computer). All sources was re-compiled but behaviour of my program is not the same. The thread 2 is never executed when... (3 Replies)
Discussion started by: Tinkh
3 Replies

7. Shell Programming and Scripting

awk -F works on Linux, but not on Solaris

Hello, I found this command works on Linux: $ echo `uptime` | awk -F "load average: " '{ print $2 }' 1.60, 1.53, 1.46 but got error on Solaris: $ echo `uptime` | awk -F "load average: " '{ print $2 }' awk: syntax error near line 1 awk: bailing out near line 1 $ which awk... (2 Replies)
Discussion started by: seafan
2 Replies

8. Shell Programming and Scripting

Problem with awk awk: program limit exceeded: sprintf buffer size=1020

Hi I have many problems with a script. I have a script that formats a text file but always prints the same error when i try to execute it The code is that: { if (NF==17){ print $0 }else{ fields=NF; all=$0; while... (2 Replies)
Discussion started by: fate
2 Replies

9. Shell Programming and Scripting

Awk problem: How to express the single quote(') by using awk print function

Actually I got a list of file end with *.txt I want to use the same command apply to all the *.txt Thus I try to find out the fastest way to write those same command in a script and then want to let them run automatics. For example: I got the file below: file1.txt file2.txt file3.txt... (4 Replies)
Discussion started by: patrick87
4 Replies

10. UNIX Desktop Questions & Answers

Linux not seeing Solaris

We have a "Sunw,ultra-2;sparc sun4u" server running Solaris 5.5.1, and I'm trying to get our Linux ftp server running Red Hat software to interface with the Sun Solaris. Our administrator was let go last week and I,m a Mac operator that knows little about PC or net working. All help would be... (1 Reply)
Discussion started by: Tim
1 Replies
Login or Register to Ask a Question