3 ms·
The POSIX specification includes awk, but not perl or python. The world of UNIX and UNIX-likes is larger than just Linux distributions. Depending on the utility
by greggyb 5y ago
The POSIX specification includes awk, but not perl or python. The world of UNIX and UNIX-likes is larger than just Linux distributions. Depending on the utility you plan on building and the platforms you expect it to run on, it may be wiser to reach for awk than other PLs.
- pcwalton 5y agoModern BSDs, macOS, and Solaris certainly have Perl and Python. (iOS and Android don't, but they don't have awk either.) What other Unixes are you thinking of? AIX, HP/UX, IRIX, UnixWare, etc. should be considered retrocomputing at this point and not relevant to modern compatibility discussions. Linux distros based on busybox, as mentioned elsewhere in this thread, are a more compelling reason for considering awk than considerations involving other Unixes.
- cogman10 5y agoWasn't awk added to android in 9?
- Aptrug 5y agoYep, https://android.googlesource.com/platform/system/core/+/master/shell_and_utilities/README.md#android-9_0-pie https://android.googlesource.com/platform/system/core/+/mast...
- bdk0 5y agoYou can install python and perl on BSDs, but its different than awk, where its part of the core OS and guaranteed to be there without needing to install extra stuff.
- comex 5y agoWhen it comes to Python on macOS, the only version that’s installed by default is the deprecated copy of Python 2.7 that’s slated to be removed in the future. For Python 3, you need to install the developer tools. (/usr/bin/python3 ships with the OS, but is just a stub that runs the developer tools version if installed or prompts you to install it otherwise). It’s not hard to install, but it’s not guaranteed to already be installed on every system.
- michaelcampbell 5y ago> The world of UNIX and UNIX-likes is larger than just Linux distributions The post I was replying to specifically said Linux distros.