in reply to Re: shebang problem on openSUSE
in thread shebang problem on openSUSE
Thanks for replying.
"A search on DuckDuckGo brings up some relevant results."
That is, in fact, the search engine I used. Could you post the URL you used which returned the "relevant results". I seached for "shebang perl openSUSE", which ended up as this URL: https://duckduckgo.com/?q=shebang+perl+openSUSE&t=opensuse&ia=qa.
I didn't see any results where 'perl -l' (or 'perl -w' or similar) was treated as a single filename containing a space character. As I wrote that, I thought I might try the same code as before with this shebang line:
#!/usr/bin/env perl -w
When run, that now produces:
ken@ibm-laptop:~/tmp> test_shebang.pl /usr/bin/env: perl -w: No such file or directory
I checked "man env" and subsequently, from the information it suplied, "info '(coreutils) env invocation'" and http://www.gnu.org/software/coreutils/manual/coreutils.html#env-invocation. All show an invocation of this form:
env [option]… [name=value]… [command [args]…]
As far as I can see, none mention anything special about the space after "command".
I've been using shebang lines like this for over a decade. I would have posted dozens (if not hundreds) of scripts on this site using "#!/usr/bin/env perl -l" without a single complaint.
If 'perl -l' is being interpreted as a single filename (containing a space character), that would be most unusual behaviour and I would hope there would be a way to turn it off.
— Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: shebang problem on openSUSE
by beech (Parson) on Mar 24, 2018 at 06:45 UTC | |
by kcott (Archbishop) on Mar 24, 2018 at 19:49 UTC | |
|
Re^3: shebang problem on openSUSE
by Anonymous Monk on Mar 24, 2018 at 09:30 UTC | |
by kcott (Archbishop) on Mar 24, 2018 at 19:11 UTC |