porting shell script from Linux to AIX.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting porting shell script from Linux to AIX.
# 1  
Old 12-26-2007
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
# 2  
Old 12-27-2007
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?
# 3  
Old 12-27-2007
Quote:
Originally Posted by joy_1
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
# 4  
Old 12-27-2007
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.
# 5  
Old 12-27-2007
run ksh -n script.ksh

This should give you the line where the syntax error is

can you post the entire script?
# 6  
Old 12-27-2007
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.
# 7  
Old 12-27-2007
Perhaps you have somehow converted into DOS format?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AIX UNIX (kshell) to Linux Shell Script Migration.

Hi, Could you please let me know what kind of changes/issues commonly occurs at Scripting /command level during AIX Unix (kshell) to Linux shell script migration. (24 Replies)
Discussion started by: Raghuraman.R
24 Replies

2. Shell Programming and Scripting

Porting script from Solaris to Linux

I have a script which has commands that are located in different paths on my Linux o/s than on Solaris. For example, to make uname work, I need to do it this way in Solaris: my $host= `/usr/bin/uname -n` But in Linux it is: my $host = `/bin/uname -n`I have this issue with at least 5... (8 Replies)
Discussion started by: newbie2010
8 Replies

3. Windows & DOS: Issues & Discussions

Porting Unix c-shell script to Window under MKS-Tookit

Please ignore this question. (0 Replies)
Discussion started by: Sommerville
0 Replies

4. AIX

Porting from HP-UX to AIX

I am orignally a VC++ programmer, this is the my post in UNIX form. I have an existing source code, that was developed in old HP-UX system, the objective is to make it work on new AIX system. It does'nt appear that AIX has the necessary libraries or even run the application if its... (0 Replies)
Discussion started by: maverick786us
0 Replies

5. UNIX for Advanced & Expert Users

Porting Linux and TTY / Shell problems

Hello all, I am porting the linux 2.6.30rc2 kernel from one ARM architecture, /arch/arm/mach-davinci, to a new device, called Jacinto2. I am using the serial port ttyS0 as the default console. The bootloader is U-Boot and I am using busybox mounted as a ramdisk in internal SDRAM. I have got... (4 Replies)
Discussion started by: Interloper
4 Replies

6. AIX

pgrep substitute for porting a linux script to AIX 5.x

Hi, I'm trying to get this script to work on an AIX 5.3 box, I couldn't get pgrep for AIX, I also realize that ps works differently on the IBM boxes. Could anybody just give me the specifics of a work around for my problem, I'll adjust the whole script: #!/bin/bash # applabs.com #to do: #... (3 Replies)
Discussion started by: thebytegrill
3 Replies

7. UNIX for Advanced & Expert Users

Porting linux ftpd code to Aix

Dear All, I have already ported the linux ftpd daemon to AIX earlier. When the ftp client does a "DIR" command, I have intercepted the call to the remote machine at the server code and added my code to browse IBM Message Queue, so that the client will see the files in the IBM Message... (2 Replies)
Discussion started by: srksn
2 Replies

8. UNIX for Advanced & Expert Users

Porting GNU FTPD daemon from Linux to AIX

Dear All, I want to port GNU ftpd daemon server from Linux to AIX. I want to download GNU ftpd daemon for linux. Please tell me from where I can download this code and which code will be most suitable for this porting? Please help in this regard. Thanks Siva (0 Replies)
Discussion started by: srksn
0 Replies

9. Programming

Porting of Shell to AIX

Hi All, I would like to know of the steps needed for the implementation of a shell in AIX. This shell is written by one of our developers and is currently running in Solaris. This needs to be ported to AIX. Does any of you guys know the implementation steps to do this. If so please do let me... (5 Replies)
Discussion started by: dhanamurthy
5 Replies

10. AIX

Porting C codes from HP-UX to AIX

Hi , Can someone help me get some support documents on the common issues/pitfalls and any other details with respect to porting the application running on C codes from HP-UX to AIX. Help will be valuable. Thanks a lot (0 Replies)
Discussion started by: Sinbad
0 Replies
Login or Register to Ask a Question