error when executing shell scrpit


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting error when executing shell scrpit
# 1  
Old 06-15-2012
error when executing shell scrpit

Guys,
when i am executing the following script I am getting following error.
Code:
-bash: test.sh: command not found

Code:
$ test.sh -- script name

#! /bin/bash
echo " Job started........"   
CURRENTDIR=`pwd`
exit 0

thanks

Moderator's Comments:
Mod Comment Please view this link: How to use [code]...[/code] tags

Last edited by Scrutinizer; 06-15-2012 at 02:51 PM.. Reason: code tags
# 2  
Old 06-15-2012
It means what it says -- test.sh cannot be found.

UNIX doesn't include the current directory for commands for security reasons. You have to tell it to look there.

Code:
./test.sh

By the way, there's already a program named 'test', so that name's usually avoided for scripts.
# 3  
Old 06-15-2012
Ok it worked giving the whole path.. thanks for quick reply
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Error while executing the shell script

Hi Gurus, The following script fails with the error 'command not found' while trying to execute. As the error indicates, the script fails at ROW#30 where the EOF is defined for SQL statement. It appears that the script is trying execute the lines in the SQL output written to ta spool file.... (7 Replies)
Discussion started by: svajhala
7 Replies

2. Shell Programming and Scripting

SP2-0642 error while executing procedure from shell script

hi all, i have a unix script where i am calling a database procedure from it. while executing the procedure i am getting an error: but when i tried to call the same procedure manually then it ran successfully, i goggled this issue and found timezone.dat file missing at... (0 Replies)
Discussion started by: lovelysethii
0 Replies

3. Shell Programming and Scripting

ERROR in executing mysql querys in shell scripting

Hi All, Please see the below script for mysql 3 commands. Its giving me the right output for all three commands but showing some errors in first two commands , i guess there might be an issue with date. Can anyone help me . #! /bin/bash TABLE_NAME=testingddatabase USER_NAME=root... (3 Replies)
Discussion started by: aish11
3 Replies

4. Shell Programming and Scripting

SFTP-how to log individual sftp command error while executing shell script

Hi, I have situation where i need to automate transferring 10000+ files using sftp. while read line do if ; then echo "-mput /home/student/Desktop/folder/$line/* /cygdrive/e/folder/$line/">>sftpCommand.txt fi done< files.txt sftp -b sftpCommand.txt stu@192.168.2.1 The above... (1 Reply)
Discussion started by: noobrobot
1 Replies

5. Shell Programming and Scripting

using subsitiution in shell scrpit

I have a very (or so I thought) simple script I want to execute. The output should be 1 line of text from a web page called by lynx. #!/bin/bash cat urlList.txt while read line; do #echo $line output="$(lynx -dump -accept_all_cookies $line | sed -n '2p')" echo "$output" done I am... (3 Replies)
Discussion started by: roninuta
3 Replies

6. Linux

Error executing shell script in Linux

Hi, I have following shell script code : ------------------------------------------------------------------ #!/bin/bash SCRIPTS_DIR="/scriptsDir1" # tables login/password APIL_USER="uname/pswd" I2_USER="uname/pswd" # Database DB="db1" cd "$SCRIPTS_DIR/scriptsDir2" sqlplus... (1 Reply)
Discussion started by: Chaitrali
1 Replies

7. Shell Programming and Scripting

Error executing shell script in Linux

Hi, I have following shell script code : ------------------------------------------------------------------ #!/bin/bash SCRIPTS_DIR="/scriptsDir1" # tables login/password APIL_USER="uname/pswd" I2_USER="uname/pswd" # Database DB="db1" cd "$SCRIPTS_DIR/scriptsDir2" sqlplus... (2 Replies)
Discussion started by: Chaitrali
2 Replies

8. Shell Programming and Scripting

Error executing shell command from a perl script

Hi Gurus, I've a find command that gets the list of files from a source directory where the extension is not html, xml, jsp, shtml or htaccess. The below find command runs fine from the command prompt or in a shell script. I need to eventually run it in a PERL script and am getting the... (5 Replies)
Discussion started by: voorkey
5 Replies

9. Shell Programming and Scripting

help with scrpit

my friend has quized me.. I'm very new to scripts but I know I'm somewhat close any help would be a major help.. here is the script ex shell program, hello, to display the phrase "hello world" 50 times (script should verify the count) . Do not use a for loop! (hint should show... (5 Replies)
Discussion started by: kim187
5 Replies

10. Shell Programming and Scripting

Error message while executing the shell script

Hi All, When I am trying to execute the below shell script I got this error message. script ========== #!/bin/bash /usr/java/jdk1.5.0_10/bin/java - classpath /var/lib/asterisk/agi-bin/mysql-connector-java-3.0.15-ga-bin.jar/: /var/lib/asterisk/agi-bin/jarfiles:... (4 Replies)
Discussion started by: ajayyaduwanshi
4 Replies
Login or Register to Ask a Question