3 ms·
> can't even necessarily depend on bc/dc being available in every environment Just discovered this myself, also trying to make a language target shell. Was rea
by seiferteric 2y ago
> can't even necessarily depend on bc/dc being available in every environment
Just discovered this myself, also trying to make a language target shell. Was really surprised bc/dc was not present I think in Ubuntu install in WSL2. Also using awk for floating point math, but just shelling out to it.
- RodgerTheGreat 2y agoYep! I considered shelling out to AWK for the same reason, as a bc/dc alternative, but rapidly found that nearly everything else bash could do was easier and less error-prone (and workable on much older systems) if I moved the whole script into pure AWK.
- kjellsbells 2y agoOne of those occasional reminders that Linux != UNIX, I guess. Bc is mandatory in POSIX I believe but Linux never took that path. https://pubs.opengroup.org/onlinepubs/9699919799.2008edition/ https://pubs.opengroup.org/onlinepubs/9699919799.2008edition...
- nmz 2y agoHonestly the first thing I do is get busybox, busybox's behavior is at least somewhat predictable.