[Slackbuilds-users] bashisms?

B Watson yalhcru at gmail.com
Wed Sep 2 17:40:01 UTC 2015


On 9/2/15, Andrzej Telszewski <atelszewski at gmail.com> wrote:

> taking into account the shebang (maybe there are shells, that upon
> seeing shebang in the first line don't treat it as comment, but I don't
> know about it).

It's not a shell, but perl does this:

$ cat 1.sh
#!/bin/sh
echo "Hello world"

$ perl 1.sh
Hello world

$ sed -i '1c#!/usr/bin/perl' 1.sh
$ cat 1.sh
#!/usr/bin/perl
echo "Hello world"

$ perl 1.sh
String found where operator expected at 1.sh line 2, near "echo "Hello world""
(Do you need to predeclare echo?)
syntax error at 1.sh line 2, near "echo "Hello world""
Execution of 1.sh aborted due to compilation errors.

...not that that has anything to do with the original topic...


More information about the SlackBuilds-users mailing list