4 ms·
Looks like $() is really really POSIX: http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_03 http://pubs.opengroup.org/onlinepu
by apenwarr 16y ago
Looks like $() is really really POSIX:
http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_03 http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu...
In general, beware of trusting the people who wrote your editor instead just trying it to see if it works :)
- masklinn 16y agoI think it would be nifty if every title linked to the relevant section of the POSIX spec (maybe with a [POSIX] link next to the title itself). Also, OpenBSD's pdksh seems to stick quite closely to POSIX shell features, it's probably a good test environment. > In general, beware of trusting the people who wrote your editor instead just trying it to see if it works :) That runs the risk of encountering an additional feature of the current shell compared to POSIX, this is very much the source of all bashisms: just trying to see if it works.
- apenwarr 16y agopdksh (at least the one in Debian) has numerous bugs; try the shelltest.od script in redo to see some of them. I agree that "just see if it works" isn't a good portability strategy if you only test one shell. But the idea is to get as many shells as possible and try them all, or (as redo does) to write a script that accepts only shells with all the expected features. Blindly assuming POSIX compliance is a dangerous way to go, since there's no guarantee that it's in a shell just because it's in the spec. I'll grant you that using a feature that's both in POSIX and in all the shells you test is the best option, though :) $() is in both categories.