The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 06:45 AM
syntax error near unexpected token...what caused? joshuaduan Shell Programming and Scripting 8 05-14-2007 09:02 AM
sh: syntax error: `...' unexpected??? alan Shell Programming and Scripting 5 06-22-2004 06:58 PM
sh: syntax error at line 1: `>' unexpected atiato High Level Programming 2 03-16-2004 07:39 AM
syntax error: `(' unexpected adadevil UNIX for Dummies Questions & Answers 11 12-14-2001 09:17 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-14-2008
Herry Herry is offline
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..
  #2 (permalink)  
Old 03-15-2008
ghostdog74 ghostdog74 is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2006
Posts: 2,422
is that $1 or $l ??
  #3 (permalink)  
Old 03-17-2008
ShawnMilo ShawnMilo is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 252
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
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 10:51 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0