Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The article doesn't mention which are portable and which aren't.


It's a cultural thing. GNU is intended to replace Unix, so interoperability is (at best) not a priority. Same as Microsoft's “embrace, extend, extinguish”, which shows how important a good slogan is if you want your ambitions recognized.

A POSIX (or older Bourne-descended) shell can be distinguished from ‘bash --posix’ in a script with a fragment like “date&>F”, because Bash authors either didn't realize or didn't care that the sequence ‘&>’ already had meaning.


I wanted to argue that POSIX didn't define this behavior. But, reading the spec: I agree with you, Bash is non-compliant there.

According to POSIX (2016 edition)

    date&>F
should be equivalent to

    date &
    (exec >F)
where in Bash, it's equivalent to

    date >F 2>&1




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: