!/usr/bin/ksh error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting !/usr/bin/ksh error
# 1  
Old 11-12-2009
!/usr/bin/ksh error

Usually we use !/usr/bin/ksh at the start of the script.But if I am having this stuff in the scripts and calling one script from other its not working.What may be the reason behind it ?


xyz.ksh
#!/usr/bin/ksh
echo "Hi"


abc.ksh
#!/usr/bin/ksh
echo "I am fine"
ksh xyz.ksh

Its giving error " !/usr/bin/ksh: not found"

---------- Post updated at 07:15 PM ---------- Previous update was at 07:14 PM ----------

cat xyz.ksh
#!/usr/bin/ksh
echo "Hi"


cat abc.ksh
#!/usr/bin/ksh
echo "I am fine"
ksh xyz.ksh

xyz.ksh and abc.ksh are two files here
# 2  
Old 11-12-2009
Try this
Code:
#!/usr/bin/ksh
echo "I am fine"
./xyz.ksh

# 3  
Old 11-12-2009
i found the solution...we can run the code very well if we remove !/usr/bin/ksh .... but i want to understand the reason for this.

Both the scripts are working individually and if i invoke ksh shell again in the middle of the script why it is not running
# 4  
Old 11-12-2009
On what platform?
If removing the #!/usr/bin/ksh from your script lets in run could mean you have no Korn Shell..
# 5  
Old 11-12-2009
To get that exact error message the hash would have to be missing from the shebang line.
i.e
Code:
!/usr/bin/ksh
instead of the correct
#!/usr/bin/ksh

Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

/usr/bin/scp error

I have this scp script running, /usr/bin/scp -r /cerner/mgr --exclude-from=/atg/move_exclude.dat 102.126.112.68:/cerner but am getting an error: --exclude-from=/atg/move_exclude.dat: No such file or directory I am wondering if the syntax is incorrect... I also have additional... (3 Replies)
Discussion started by: Daniel Gate
3 Replies

2. Shell Programming and Scripting

/usr/bin/ksh -E

I saw one script using the first line as below /usr/bin/ksh -E I have used -x for debug but couldn't find what is this -E option for ? Pls let me know what is this -E used for Thanks RL (1 Reply)
Discussion started by: reldb
1 Replies

3. UNIX and Linux Applications

/usr/bin/ld: cannot find -lz error

I am installing lxml module for python on redhat I have installed libxml2 already. When I run for libxslt: ./configure --prefix=libxslt_folder --with-libxml-prefix=libxml2_folder It is ok the I run : make I have error: /usr/bin/ld: cannot find -lz collect2: ld returned 1 exit status I... (4 Replies)
Discussion started by: AIX_30
4 Replies

4. AIX

aix:ksh: /usr/bin/rm: 0403-027 The parameter list is too long.

Hi, I am getting the below error message When i am trying to delete the files from the directory.Could you please guide me? rm *.aud ksh: /usr/bin/rm: 0403-027 The parameter list is too long. and find /oracle/admin/testP/adump/*.aud -mtime +5 -exec rm {} \; ksh: /usr/bin/find:... (3 Replies)
Discussion started by: nokiae63
3 Replies

5. AIX

nim mksysb error :/usr/bin/savevg[33]: 1016,07: syntax error

-------------------------------------------------------------------------------- Hello, help me please. I am trying to create a mksysb bakup using nim. I am geting this error, how to correct it ? : Command : failed stdout: yes stderr: no... (9 Replies)
Discussion started by: astjen
9 Replies

6. Tips and Tutorials

The Whole Story on #! /usr/bin/ksh

Introduction Originally, we only had one shell on unix. When ran a command, the shell would attempt to invoke one of the exec() system calls on it. It the command was an executable, the exec would succeed and the command would run. If the exec() failed, the shell would not give up, instead it... (3 Replies)
Discussion started by: Perderabo
3 Replies

7. UNIX for Dummies Questions & Answers

ksh: /usr/bin/ls: arg list too long

I am using IBM AIX unix version 4.3.3.0. In a directory there are many files with different patterns. When I am trying to execute the command, ls -l with the file pattern, which have fewer files it gives the desired result. However when I am trying to execute the same command for file pattern,... (2 Replies)
Discussion started by: jitindrabappa
2 Replies

8. Shell Programming and Scripting

#!/usr/bin/ksh Command Interpreter in a sh script

Hi, I have a developer that is trying to start a script with sh "scriptname". In the script, he is specifying #!/usr/bin/ksh as the command interpreter. For some reason sh is ignoring the #!/usr/bin/ksh. We are running Solaris 8. Does anyone have any ideas what could be causing this? Here... (3 Replies)
Discussion started by: ckeith79
3 Replies
Login or Register to Ask a Question