Problem with script: ksh not found


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem with script: ksh not found
# 1  
Old 03-11-2008
Problem with script: ksh not found

Hello Guys,

what is the significance of using #!/bin/sh at the start of shell script.

my default shell is ksh, when i run my script i have ksh: not found error
and when i use ./myscript it works.

Can anyone explain me the problem please ?

tnx
# 2  
Old 03-11-2008
There is a FAQ on #! at the top of a file. It is a "magic" number that opens /bin/sh as the shell.

Not found - means it cannot open ksh Try #!/bin/ksh
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

problem in Executing script in ksh

Hi, I am in ksh. below mentioned 3 commands I executed at command prompt & got the expected results. csh source csh_infa <special command> Now I have to do this in the script in ksh. I entered it as it is. #!/bin/ksh csh source csh_infa <special command> Now after... (1 Reply)
Discussion started by: girish_kanak
1 Replies

2. Shell Programming and Scripting

Read format problem in ksh script

I have ksh script reading file like while read -r line do echo $line sleep 1 #process_file $line done<$file_nm I want to write this line to another file after some manuplation.Put $line giving me line after changing line format(space removed).Please help me how can i read line by... (3 Replies)
Discussion started by: Mandeep
3 Replies

3. Shell Programming and Scripting

Crobjob Script to Email if Problem Found

I have a script that runs in cron twice every hour. My question is, when this script finds an error and sends an email on that error, and the error recovers how do i make the script only email when there's a problem and also when there's a recovery for that problem? simply inserting a "mail... (2 Replies)
Discussion started by: SkySmart
2 Replies

4. Shell Programming and Scripting

Shell script run error ksh: not found

Hi All, I am trying to run a script to FTP files from one UNIX server to another UNIX server. Actually I can able to FTP file successfully by manually or paste whole script at prompt. But when I am trying to run script it is giving error. Please let me know the cause. #!/bin/sh... (3 Replies)
Discussion started by: nz80qy
3 Replies

5. UNIX for Dummies Questions & Answers

script sourcing problem (ksh)

I have a script "abc.sh" in /tmp which has exit 0 as its last line when I run this script from /tmp/xyz/def.sh script as . ../abc.sh then the script executes but the control doesn't return to def.sh script for subsequent commands in def.sh but if I invoke the abc.sh from inside the... (3 Replies)
Discussion started by: rakeshou
3 Replies

6. Shell Programming and Scripting

Ksh problem in script

Hi I made a small script which uses ksh. When i run the script then i get the following error However when i run each of the commands on the commandline they get executed and provide the desired output. i cant figure out why the script is not running. Kindly Help Thanks in... (3 Replies)
Discussion started by: PradeepRed
3 Replies

7. Shell Programming and Scripting

Problem in ksh script ( String comparison )

hi , i am trying to compre two strings if ] or if ] when the length of var1 is small (around 300-400 char ) it works fine but when it is large (around 900-1000 chars) it fails is there any limitations for this type of comparison ??? (3 Replies)
Discussion started by: amarnath
3 Replies

8. Shell Programming and Scripting

Newbie problem with ksh script

Hi all, I have a directory have all of the .stat and .dat file : they are is a pipe separate flat file. Example: log-20061202.stat contain 1st line and last line of log-20061202.dat with record count of that day. Example: Total record = 240 Tom|02-12-2006|1600 W.Santa... (18 Replies)
Discussion started by: sabercats
18 Replies

9. Shell Programming and Scripting

Simple ksh script problem

This is a search script that I have developed. It finds the records that I look for. However the only thing I want the program to do now is to display a message such as 'Not Found' to appear when a record is not found. So far when a search doesn't display a record, the screen is blank. ... (14 Replies)
Discussion started by: Warrior232
14 Replies

10. Shell Programming and Scripting

ksh script and java problem

I have a problem with the execution of a ksh as deamon on linux. I explain you first the context. We have developped a Java program that execute every minutes an external (that we don't have developped) program with a config file in parameter. The Java program is runned as deamon with a perl... (0 Replies)
Discussion started by: adrian.mihai
0 Replies
Login or Register to Ask a Question