File association for .sh all screwed up ?

On Sun, 01 Jun 2014 05:26:01 +0000, jetchisel wrote:

> andy77586;2646666 Wrote:
>> I found the problem.
>>
>> #!/bin/bash has to be the first line in OpenSuse.
>>
>> Was not the case in other distros as in Puppy and Mint.
>>
>> Thanks guys. :slight_smile:
>
> If you did not put a shebang on your script then it is just another text
> file, it is just a an example of the wrong idea about the *.sh extension
> in general. :wink:

That’s true, but if you set things up so that you’re doing things “the
Windows way” and executing based on the extension, then this actually
would still work.

There’s no requirement that a script have a shebang if it’s called using
the shell command itself.

ie:

bash myscript.sh

Does not (as I recall) require that myscript.sh have a shebang as the
first line.

That said, it is convention to do so, and in general is considered a best
practice.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C