3 ms·
Unix has lots of weird cruft littering its dark corners; for instance you can use : instead of #! and, if I remember correctly, the OS will use "the default she
by cduzz 4y ago
Unix has lots of weird cruft littering its dark corners; for instance you can use : instead of #! and, if I remember correctly, the OS will use "the default shell".
Similarly, you can have your shell in the GECOS field be null, and again, you'll get the default shell. I think I had a bug report in with Sun complaining that XDM or the fancy XDM replacement didn't work correctly with a null shell value. Or maybe it didn't work if you had the character "ctl-l" as your password.
It's been a while. In any case, don't do these things.
- fsckboy 4y ago> for instance you can use : instead of #! and, if I remember correctly, the OS will use "the default shell" when I learned unix around 1980, you had to start a shell script file with a single # on a line by itself, and there was no bang option... but I want to say there was a way to select sh vs csh, though I can't recall it... maybe you had to start with a couple lines of Bourneshell, and that part would relauch csh on the same file. can't remember though. A dozen years later that was a common technique to launch perl scripts tho I don't recall why.
- iforgotpassword 4y ago> Unix has lots of weird cruft littering its dark corners; for instance you can use : instead of #! and, if I remember correctly, the OS will use "the default shell". I mean, it's basically what the article says. Anything that's not an executable and doesn't start with "#!" gets passed to the default shell. ":" is no exception here.
- jjgreen 4y ago> Unix has lots of weird cruft littering its dark corners Indeed it does -- try logging in to your Linux machine with your username in all-caps :-)
- GekkePrutser 4y agoThat does have a specific reason, it's not an arbitrary old thing. It's to support terminals that don't do lowercase. Like some old terminals such as Dec VT05 or TTYs (the ones that printed on paper often didn't support this or they had a mode-switch character for it rather than separate characters) Old as it is, I'm sure these are still around in some production environments.