Cann ot execute a shell command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Cann ot execute a shell command
# 1  
Old 05-27-2009
Question Cann ot execute a shell command

Hi ,

I am new to UNIX and Shell scripting . I am not able to execute a shell file . I try to do it using the below command.

./start.sh

but it shows an error that 'cannot execute ' what might be the reason for this? pls help me to resolve it.
# 2  
Old 05-27-2009
Quote:
Originally Posted by Deepakkumard
./start.sh

but it shows an error that 'cannot execute '
Sounds like the file start.sh is missing the x mode bits.

Code:
chmod u+x start.sh

Also you should explicitly state in the first line of the script what is the interpreter program that should be invoked to run the rest of the script.
For a shell script one of the following should do:
#!/bin/sh
#!/bin/ksh
#!/bin/bash
#!/bin/csh
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to execute application command in shell script?

friends, i have application commands to execute in shell script it is something like this. i will login with user data it takes me to $ prompt. Example given below login: data ps : xxxx $ MNSinput --this takes me to greater than prompt > > ops --this is command i enter this output... (7 Replies)
Discussion started by: udaykrishna
7 Replies

2. Shell Programming and Scripting

When i am trying to execute export command within a shell script it is saying command not found.

I am running the export command within a view to use that value inside my build script. But while executing it it is saying "export command not found" My code is as follows: -------------------------- #!/bin/sh user="test" DIR="/bldtmp/"$user VIEW="test.view1" echo "TMPDIR before export... (4 Replies)
Discussion started by: dchoudhury
4 Replies

3. UNIX for Dummies Questions & Answers

How to execute command after telneting in shell script?

Hi , I have to write a shell script to telnet to specific host and execute the admin command there. Please help me to do that. Eg : telnet hostname portno admin command exit (3 Replies)
Discussion started by: arukuku
3 Replies

4. UNIX for Dummies Questions & Answers

ssh command to execute shell script in another server

ssh -q <hostname> /opt/tcs/satish/tst.ksh ssh -q <anotherserver> /opt/tcs/satish/tst.ksh tst.ksh has "nohup <command> & " when i execute below script , its throwing error as nohup can not be found ssh -q <anotherserver> /opt/tcs/satish/tst.ksh > log & can someone let me... (5 Replies)
Discussion started by: only4satish
5 Replies

5. Shell Programming and Scripting

Execute a shell script after a particular command is run

Hi, I need to run a script whenever the Cron file is modified. The requirement is whenever a user modifies the cron file, the script should run automatically. Can you please provide your inputs ? (5 Replies)
Discussion started by: harneet2004us
5 Replies

6. Shell Programming and Scripting

write a shell script to execute a command

Hello all, I have just started doing shell scripting. I want to read a file which stores the status of my job I have submitted on a cluster. The file looks something like this : ========================FILE============================= crab: Checking the status of all jobs: please wait... (4 Replies)
Discussion started by: learn_linux
4 Replies

7. Shell Programming and Scripting

the shell not pause when execute read command

Hi, i facing a problem when run the script below.. while do if then printf "Please enter a name : " read response # the problem occur here if then ea_ident=${omc_ident} else # # Check that name does not contain invalid... (14 Replies)
Discussion started by: neruppu
14 Replies

8. Shell Programming and Scripting

shell script to execute user command

I don't know why the following shell script doesn't work. Could you please help me out? #!/usr/bin/ksh test="cal > /tmp/tmp.txt 2>&1" $test I know it will work for the following format: #!/usr/bin/ksh cal > /tmp/tmp.txt 2>&1 However, I need to get the command from the user in... (1 Reply)
Discussion started by: redtiger
1 Replies

9. Shell Programming and Scripting

execute a command silently or quietly within a shell

How do I suspend output of commands and tools that sometimes utter unwanted output? I know that I can always pipe to null or some such thing, but is there a simpler more elegant (i.e. accepted) practice? (4 Replies)
Discussion started by: lumix
4 Replies

10. Shell Programming and Scripting

execute shell command in perlscript

Hi I have this below script...I want to execute the shell command "rm" in the below script but it is not working. Can anybody why so? I got the below error rm: /users/amvarma is a directory sh: /*-log*: not found ------------------- $u=`whoami`; print "$u\n"; $op_1=$ARGV; # for... (0 Replies)
Discussion started by: amitrajvarma
0 Replies
Login or Register to Ask a Question