I try to run a script which has

#!/bin/bash

but i am getting error as "Illegal option --"
/bin/sh is not bash , aborting

. i try to change the first line to

 #!/bin/sh

this time it is saying
x: unexpected operator

i tried runnigscript with ./ and sh, but both are failing.

please help.

Recommended Answers

All 4 Replies

Hello,

In order to help we will need three things:
A listing of the shell script with the permissions on the file.
A listing of the code in the file.
The actual command line you are using to call the script.

When you type which bash in the terminal, what is the output?

command

$which bash 

gives /bin/bash

So you are calling bash from the correct location it has to be in your script. Can you give us the command line you are using and the script to look at or we wont be able to help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.