03-15-2008
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..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to run the script bellow but its given me "syntax error at line 20 :'done' unexpected." error message"
can someone check to see if the script is ok? and correct me pls.
Today is my first day with scripting.
Gurus should pls help out
#!/bin/ksh
# Purpose: Check to see if file... (3 Replies)
Discussion started by: ibroxy
3 Replies
2. Shell Programming and Scripting
Hi All,
I have written a korn script (code pasted below). It is giving the error while debugging "new.sh: syntax error at line 62: `end of file' unexpected".
I have re-written the whole code in VI and explored all help related to this error on this Unix forum and tried it. Somehow, I could... (7 Replies)
Discussion started by: schandrakar1
7 Replies
3. Shell Programming and Scripting
I have a very simple script that reads in the contents of a file (_open.txt) into an array "lyrics":
#!/bin/sh
# read in the text
lyrics=( `cat _open.txt` | tr '\n' ' ')
exit 0
It gives the following error message:
./lyrics.sh: 1: Syntax error: word unexpected (expecting ")")
I have... (9 Replies)
Discussion started by: figaro
9 Replies
4. Shell Programming and Scripting
Hello forum,
I hope my problem is easy to solve for someone in here!
My main task is to copy a large amount of imap-accounts from one server to another. There is a tool (Perl) called imapsync which does the job exellent. Unfortunately I'm only able to run it on one account at a time.
After... (3 Replies)
Discussion started by: primaxx
3 Replies
5. Shell Programming and Scripting
the below code will search attr string inside makefile under the modelno on given path.
echo "Enter model no for searching string inside makefile"
read inputs2
#find /pools/home_unix/sapte/work/models/model/$inputs2 -name "makefile" | xargs grep "attr" \;
#;;I am getting below error.... (7 Replies)
Discussion started by: lathigara
7 Replies
6. Shell Programming and Scripting
Hi Techies,
can anyone please debug the following Script and let me know what is going wrong here.
im getting the following error
#!/usr/bin/bash
# ##############################################################################################
#
# Variables
#
#... (2 Replies)
Discussion started by: mahi_mayu069
2 Replies
7. Shell Programming and Scripting
Hi All,
Please hav a look at the below peice of script and let me know if there are any syntax errors.
i found that the below peice of Script is causing issue. when i use SFTP its working fine, but there is a demand to use FTP only. please find below code and explain if anything is wrong... (1 Reply)
Discussion started by: mahi_mayu069
1 Replies
8. Shell Programming and Scripting
While i m running below code, it is giving me the error"syntax error at line 15: `end of file' unexpected".
Pls let me know what is wrong here..i tried many ways, but no luck
dbSID="SWQE"
usrname="apps"
password="Wrgthrk3"
count=0
while
do
sqlplus $usrname/$password@$dbSID... (5 Replies)
Discussion started by: millan
5 Replies
9. BSD
#!/bin/bash
#--------------------------------------------------------
# Setup prompt
# Author Zeeshan Mirza
# Data: 06-08-2017
#--------------------------------------------------------
if
then
. ./.profile_custom_pre
fi
umask 022
set -o vi
export EDITOR=vi
export VISUAL=vi... (3 Replies)
Discussion started by: getzeeshan
3 Replies
10. Shell Programming and Scripting
Hello all,
I am running a script to generate a report and mail it to an email address.
When I am trying to validate whether the file is a 0 kb file, I am getting the below error.
Error: "Syntax error; unexpected end of file"
Any suggestions please?
Code:
#!/bin/sh
.... (1 Reply)
Discussion started by: Pradeep_Raj
1 Replies
LEARN ABOUT DEBIAN
html::formhandler::field::date
HTML::FormHandler::Field::Date(3pm) User Contributed Perl Documentation HTML::FormHandler::Field::Date(3pm)
NAME
HTML::FormHandler::Field::Date - a date field with formats
VERSION
version 0.40013
SUMMARY
This field may be used with the jQuery Datepicker plugin.
You can specify the format for the date using jQuery formatDate strings or DateTime strftime formats. (Default format is format =>
'%Y-%m-%d'.)
d - "%e" - day of month (no leading zero)
dd - "%d" - day of month (two digit)
o - "%{day_of_year}" - day of the year (no leading zeros)
oo - "%j" - day of the year (three digit)
D - "%a" - day name short
DD - "%A" - day name long
m - "%{day_of_month" - month of year (no leading zero)
mm - "%m" - month of year (two digit) "%m"
M - "%b" - month name short
MM - "%B" - month name long
y - "%y" - year (two digit)
yy - "%Y" - year (four digit)
@ - "%s" - Unix timestamp (ms since 01/01/1970)
For example:
has_field 'start_date' => ( type => 'Date', format => "dd/mm/y" );
or
has_field 'start_date' => ( type => 'Date', format => "%d/%m/%y" );
You can also set 'date_end' and 'date_start' attributes for validation of the date range. Use iso_8601 formats for these dates ("yyyy-mm-
dd");
has_field 'start_date' => ( type => 'Date', date_start => "2009-12-25" );
Customize error messages 'date_early' and 'date_late':
has_field 'start_date' => ( type => 'Date,
messages => { date_early => 'Pick a later date',
date_late => 'Pick an earlier date', } );
If form has 'is_html5' flag active it will render <input type="date" ... /> instead of type="text"
AUTHOR
FormHandler Contributors - see HTML::FormHandler
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Gerda Shank.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-06-25 HTML::FormHandler::Field::Date(3pm)