Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: shebang problem on openSUSE

by kcott (Archbishop)
on Mar 24, 2018 at 05:15 UTC ( [id://1211647]=note: print w/replies, xml ) Need Help??


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

      ++ Thanks beech, that answers my question and resolves the issue.

      The table showing different behaviours was particularly helpful. It would appear that I have mostly been using OSes that do parse all arguments separately; for instance, I've had Mac OS X at home for the last eight years and that's what I would have used, almost exclusively, for scripts I've posted on this site. I was quite unaware that wasn't the normal case: hence my surprise at the behaviour on this borrowed laptop.

      — Ken

Re^3: shebang problem on openSUSE
by Anonymous Monk on Mar 24, 2018 at 09:30 UTC

      Thanks. That's better search criteria and produces, as you said, "some relevant results".

      — Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1211647]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-20 00:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found