Awk Syntax Error Near Line
Contents |
HCL Search Reviews Search ISOs Go to Page... LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie [SOLVED] Need solution for awk: syntax
Awk Printf Syntax Error
error near line 1 ERROR User Name Remember Me? Password Linux - Newbie awk syntax error near line 1 awk bailing out near line 1 This Linux forum is for members that are new to Linux. Just starting out and have a question? /etc/sudoers syntax error near line 1 If it is not in the man pages or the how-to's this is the place! Notices Welcome to LinuxQuestions.org, a friendly and active Linux Community. You are currently viewing LQ as
Awk Bailing Out Near Line 1 Solaris
a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today! Note that registered members see fewer ads, and ContentLink is completely disabled once you log in. Are you new to LinuxQuestions.org? Visit
"nawk -v"
the following links: Site Howto | Site FAQ | Sitemap | Register Now If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here. Having a problem logging in? Please visit this page to clear all LQ-related cookies. Introduction to Linux - A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own. Click Here to receive this Complete Guide absolutely free. Search this Thread 10-11-2012, 03:56 AM #
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. http://www.linuxquestions.org/questions/linux-newbie-8/need-solution-for-awk-syntax-error-near-line-1-error-4175431628/ Join them; it only takes a minute: Sign up problem with shell variables in awk up vote 0 down vote favorite I have a command which is executed successfully on command line: ls -l | awk '/Sep 26/{split($8,a,":");if(a[1]a[2]>=1045 && a[1]a[2]<=1145)print $9}' I am including the same thing in a shell script below: #!/bin/ksh date1=$1 date2=$2 time1=$3 time2=$4 ls -l| http://stackoverflow.com/questions/7552588/problem-with-shell-variables-in-awk awk -v d1=${date1} -v d2=${date2} -v t1=${time1} -v t2=${time2} '/d1 d2/{split($8,a,":");if(a[1]a[2]>=t1 && a[1]a[2]<=t2) print $9}' But this does not work.please see below the execution ksh -vx test.sh Sep 26 1045 1145 #!/bin/ksh date1=$1 + date1=Sep date2=$2 + date2=26 time1=$3 + time1=1045 time2=$4 + time2=1145 ls -l| awk -v d1=${date1} -v d2=${date2} -v t1=${time1} -v t2=${time2} '/d1 d2/{split($8,a,":");if(a[1]a[2]>=t1 &&a[1]a[2]<=t2)print $9}' + awk -v d1=Sep -v d2=26 -v t1=1045 -v t2=1145 /d1 d2/{split($8,a,":");if(a[1]a[2]>=t1 &&a[1]a[2]<=t2)print $9} + ls -l awk: syntax error near line 1 awk: bailing out near line 1 I am using Solaris OS:I have tried with nawk now but there is no error but also there is no output. pearl[ncm_o11.2_int.@].293> ksh -vx test.sh Sep 26 1045 1145 #!/bin/ksh date1=$1 + date1=Sep date2=$2 + date2=26 time1=$3 + time1=1045 time2=$4 + time2=1145 ls -l| nawk -v d1=${date1} -v d2=${date2} -v t1=${time1} -v t2=${time2} '/d1 d2/{split($8,a,":");if(a[1]a[2]>=t1 &&a[1]a[2]<=t2)print $9}' + ls -l + nawk -v d1=Sep -v d2=26 -v t1=1045 -v t2=1145 /d1 d2/{split($8,a,":");if(a[1]a[2]>=t1 &&a[1]a[2]<=t2)print $9} When i am executing with out the shell variables inside the scri
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About http://stackoverflow.com/questions/19250239/awk-script-error-on-solaris Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the https://groups.google.com/d/topic/comp.unix.shell/Iy0z19W33BQ Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up awk script error on solaris up syntax error vote 0 down vote favorite I have following script and trying to run it: BEGIN { start = 0 } { if (match($0, "
from GoogleSign inHidden fieldsSearch for groups or messages