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
how to execute a batch script from shell script lakshmis10 Shell Programming and Scripting 1 10-17-2007 09:43 AM
execute script tonet Shell Programming and Scripting 1 10-17-2007 03:01 AM
script execute or no execute Kespinoza97 Shell Programming and Scripting 4 06-23-2007 06:27 AM
Is it possible to execute shell script with PHP? Micz Shell Programming and Scripting 1 05-27-2004 08:52 AM
execute a script tinydejong UNIX for Dummies Questions & Answers 2 07-07-2002 11:44 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-02-2006
Registered User
 

Join Date: Nov 2004
Posts: 41
Can't execute a script

I have a script with a .sh extension. When I try to run it from the command line using: test.sh ,I get this message: ksh: test.sh: not found


How do I run this?
Reply With Quote
Forum Sponsor
  #2  
Old 06-02-2006
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
check whether the path where the script is available is with env var $PATH

check if the script is executable

run it as ./test.sh in the current path itself if you dont want to edit the $PATH var
Reply With Quote
  #3  
Old 06-02-2006
Registered User
 

Join Date: May 2006
Location: London
Posts: 19
Check the working directory

if test.sh don't have execute permissions
it will give error
ksh: test.sh: cannot execute
but u r getting error canno found.
U check current working directory by
pwd
then check where the file test.sh exists.
Include the path of test.sh directory in PATH of ur profile.
Reply With Quote
  #4  
Old 06-02-2006
Registered User
 

Join Date: Feb 2006
Location: Southern England
Posts: 102
you probably have ^M chars in the file.
do a cat -vets and if so dos2unix
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:22 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