Live data from Hacker News

# - the Unix truth

homepages.cwi.nl

1–10 of 17 posts

Re: # - the Unix truth

#4

Interesting that he uses a space after the #!. I don't think I've ever done so.

From the article:

    It is rumored that some systems only recognize an 
    executable script when it starts with the four bytes
    `#! /', probably because the GNU autoconf manual says so,
    but it seems impossible to find confirmation for this rumor.

Re: # - the Unix truth

#5
post #4

Interesting that he uses a space after the #!. I don't think I've ever done so.

From the article: It is rumored that some systems only recognize an executable script when it starts with the four bytes `#! /', probably because the GNU autoconf manual says so, but it seems impossible to find confirmation for this rumor.

I actually took a weeklong shell course through work where the instructor said not to put whitespace in there.

However, I've never read of any systems that have a problem with whitespace, so I suppose it's just as well to include it.

Re: # - the Unix truth

#6
>If there is such nonblank text then for [most unices] this group consists of precisely one argument, as in the example above where argi consists of the single argument "-a -b".

Interesting. This seems pretty unintuitive, I would expect the "-a", "-b" behaviour. (I recognise that this would be more complicated to implement and make it impossible to pass an argument with spaces.) It seems like it could easily cause problems especially if you use `env` to handle paths. But I don't think I've ever run afoul of this.

Re: # - the Unix truth

#7

'This usually leads to screenfuls of error messages and users praying that in this megabyte of binary garbage no valid shell commands occur' hit a nerve.

Yeah I had a good laugh because it explains (at least some) of the times I've seen my shell behave like this.

Re: # - the Unix truth

#8

'This usually leads to screenfuls of error messages and users praying that in this megabyte of binary garbage no valid shell commands occur' hit a nerve.

A similar problem is accidentally dumping binary data to the terminal screen (via an incautious grep, for example), as various bytes get rendered as their corresponding control characters. This is even worse on windows (or at least used to be, I think Win 7 fixed this) where ^G is hard-wired to the system speaker which is fairly difficult to mute effectively.

Re: # - the Unix truth

#9

'This usually leads to screenfuls of error messages and users praying that in this megabyte of binary garbage no valid shell commands occur' hit a nerve.

A similar problem is accidentally dumping binary data to the terminal screen (via an incautious grep, for example), as various bytes get rendered as their corresponding control characters. This is even worse on windows (or at least used to be, I think Win 7 fixed this) where ^G is hard-wired to the system speaker which is fairly difficult to mute effectively.

That's a bit more innocent though, since reset(1) usually helps.

Re: # - the Unix truth

#10
post #6

>If there is such nonblank text then for [most unices] this group consists of precisely one argument, as in the example above where argi consists of the single argument "-a -b". Interesting. This seems pretty unintuitive, I would expect the "-a", "-b" behaviour. (I recognise that this would be more complicated to implement and make it impossible to pass an argument with spaces.) It seems like it could easily cause pr…

I miss the old FreeBSD parameter behavior when I could have shebang lines like:

  #!/usr/local/bin/sudo -u someuser /bin/sh
Post reply on HN