TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

# - the Unix truth

36 pointsby jluxenbergalmost 15 years ago

5 comments

justintntalmost 15 years ago
'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.
评论 #1538343 未加载
评论 #1537603 未加载
评论 #1537431 未加载
philhalmost 15 years ago
&#62;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".<p>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.
评论 #1537886 未加载
评论 #1537933 未加载
ablealalmost 15 years ago
&#62; Many Unix systems will consider a `\r' in a DOS-type line-ending (`\r\n') part of the interpreter arguments. (HP-UX, Solaris, UnixWare ignore trailing `\r'. AIX, BSD/OS, FreeBSD, Linux, OpenBSD, Tru64 do not.)<p>"/bin/sh^M: bad interpreter: No such file or directory" is what Linux gives nowadays after a shell script is edited in Windows' Notepad. I have an idea it used to be more cryptic.<p>Probably a common failure point, if people use small local scripts in their work-flow, and happen to tweak one in a Windows machine.
kree10almost 15 years ago
There is at last one more case: binfmt_misc on Linux, which gives you Windows-style run-based-on-file-extension.<p>I had a run-in with it on a shared host with some PHP cron jobs (don't ask). The hosting company changed the handler for *.php and everything broke until I renamed the files. The whole story:<p><a href="http://serverfault.com/questions/82296/when-do-file-extensions-override-shebang-lines-on-linux" rel="nofollow">http://serverfault.com/questions/82296/when-do-file-extensio...</a>
randallsquaredalmost 15 years ago
Interesting that he uses a space after the #!. I don't think I've ever done so.
评论 #1537007 未加载