The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
when porting from HP-UX to Linux amitpansuria Linux 1 04-17-2008 11:08 PM
Porting From Linux To Hpux anak0nda High Level Programming 8 10-31-2007 03:51 PM
pgrep substitute for porting a linux script to AIX 5.x thebytegrill AIX 3 08-23-2007 04:28 AM
Porting of Shell to AIX dhanamurthy High Level Programming 5 03-07-2007 07:37 AM
HP-UX to linux porting arunprakash UNIX for Dummies Questions & Answers 0 02-21-2005 02:49 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 12-26-2007
Registered User
 

Join Date: Dec 2007
Posts: 3
porting shell script from Linux to AIX.

Hi,

I am porting one shell script from Linux to AIX. I had .ksh file and i have changed it to .sh file for aix. on linux this script is running fine but on aix it gives me "unexpected end of file" error.

Could any one suggest me what to do to port this script error free?

Thanks in advance!!

Joy
Reply With Quote
Forum Sponsor
  #2  
Old 12-26-2007
Resident BOFH
 

Join Date: Dec 2007
Posts: 262
Changing the extension of a file does not change what shell executes it. You need to change the first line. Fyi - sh and ksh are the same thing on AIX.

How did you transfer the file over? Did you FTP in binary mode by any chance?

What does the output of file yourscript.sh return?

What does the output of cat -v yourscript.sh return?
Do you see embedded characters?
Reply With Quote
  #3  
Old 12-26-2007
Registered User
 

Join Date: Sep 2006
Posts: 1,580
Quote:
Originally Posted by joy_1 View Post
Hi,

I am porting one shell script from Linux to AIX. I had .ksh file and i have changed it to .sh file for aix. on linux this script is running fine but on aix it gives me "unexpected end of file" error.

Could any one suggest me what to do to port this script error free?

Thanks in advance!!

Joy
show the scripts
Reply With Quote
  #4  
Old 12-26-2007
Registered User
 

Join Date: Dec 2007
Posts: 3
thanks for ur reply frank!

I did change the first line from #!/bin/sh to #!/bin/ksh.
i transfered the file over ftp only and in binary mode.
when i execute the file it says -
unexpected EOF while looking for matching ``'
syntax error: unexpected end of file

though i have not changed anything in the file.

there are no extra embedded characters in the file.
Reply With Quote
  #5  
Old 12-26-2007
Resident BOFH
 

Join Date: Dec 2007
Posts: 262
run ksh -n script.ksh

This should give you the line where the syntax error is

can you post the entire script?
Reply With Quote
  #6  
Old 12-26-2007
Registered User
 

Join Date: Dec 2007
Posts: 3
I dont think i am allowed to put this script over net. this is not a single script file. it calls many other files also.
the line where it gave me error was an echo statement.

echo "DEBUG(gcFunc): TEST_DIR --> ${TEST_DIR}"

the error is :
Syntax error at line 537 : `>' is not expected.

if i remove this '>' from the statement it gives me error in another echo statement-
echo "${scriptname} -c <cluster-alias> -t <tester-name> -a <application-template> [-i <wls-jdk-home>]"
saying-Syntax error at line 656 : `<' is not expected

and even after removing '<' from line 656, it gives error in the following line-
TEST_CONFIG=""
Syntax error at line 707 : `"' is not matched

but i can not remove this line.
i have searched whole file for any unmatching ' " '. but there is'nt any.
Reply With Quote
  #7  
Old 12-26-2007
Ygor's Avatar
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,249
Perhaps you have somehow converted into DOS format?
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:27 AM.


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 Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0