The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
"syntax error at line 21 :'done' unexpected." error message" ibroxy Shell Programming and Scripting 3 08-08-2007 03:45 AM
syntax error near unexpected token...what caused? joshuaduan Shell Programming and Scripting 8 05-14-2007 06:02 AM
sh: syntax error: `...' unexpected??? alan Shell Programming and Scripting 5 06-22-2004 03:58 PM
sh: syntax error at line 1: `>' unexpected atiato High Level Programming 2 03-16-2004 03:39 AM
syntax error: `(' unexpected adadevil UNIX for Dummies Questions & Answers 11 12-14-2001 05:17 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-14-2008
Registered User
 

Join Date: Mar 2008
Posts: 1
Post awk Shell Script error : "Syntax Error : `Split' unexpected

hi there

i write one awk script file in shell programing
the code is related to dd/mm/yy to month, day year format

but i get an error

please can anybody help me out in this problem ??????

i give my code here including error

awk `
# date-month -- convert mm/dd/yy to month day, Year
BEGIN {
listmonths = "January,Febmary,March,April,May,June,"
listmonths = listmonths "July,August,September,"
listmonths = listmonths "October,November,December"
split(listmonths, month, ",")
}

$1 != "" {
sizeOiArray = split($l, date, "/")
if (sizeOfArray == 1)
sizeOfArray = split($l, date, "-")
if (sizeofArray == 1)
exit
date[1] += 0
print month[date[1]], date[2]", 19" date[3]
}`

error : Syntax Error : `split' unexpected

please do something to solve my problem..
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-15-2008
Registered User
 

Join Date: Sep 2006
Posts: 1,543
is that $1 or $l ??
Reply With Quote
  #3 (permalink)  
Old 03-17-2008
Registered User
 

Join Date: Jun 2006
Posts: 164
I don't know the answer to the main question, but you have a typo which is possibly contributing to the problem:

sizeOiArray instead of sizeOfArray
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:29 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0