1839470 Members
2863 Online
110146 Solutions
New Discussion

Re: run script error

 
hanyyu1
Advisor

run script error

when I run a script in the linux shell ( the script only display the linux current path ) , but pop the below error ": bad interpreter: No such file or directory" , can suggest what is wrong ? thx

#vi script1
#!/bin/bash
pwd

#./script1
: bad interpreter: No such file or directory
4 REPLIES 4
Vipulinux
Respected Contributor

Re: run script error

Hi

Try running the script using the
#sh script1

or change the permission of script1 to execute for the user
chmod 755 script1

Hope this helps.
cheers

hanyyu1
Advisor

Re: run script error

thx all,

The problem is fixed ,

thx for help.
Stuart Browne
Honored Contributor

Re: run script error

.. I was just gonna as if '/bin/bash' exists ..
One long-haired git at your service...
Alan_152
Honored Contributor

Re: run script error

try #!/bin/sh for most linux platforms...