3 ms·
> I don't understand why more people did not accept this as a viable solution Mostly because it's a pain in the ass, I've tried doing it and not only do you ha
by masklinn 12y ago
> I don't understand why more people did not accept this as a viable solution
Mostly because it's a pain in the ass, I've tried doing it and not only do you have to be careful to stick to POSIX, you also have to avoid shell and binary extensions (e.g. `echo -e` would print `-e` with a POSIX echo, it won't with GNU echo or most shell builtins). Even testing it multiple posix-compatible and userland environments, you never really know whether your script actually is cross-platform.
It'd be nice to have an environment (shell and binaries) which implements only POSIX and warns/errors when triggering common extensions.
- reirob 12y agoThat's a great idea to have a minimal POSIX distribution/environment, which contains only POSIX commands and functions (as well for portable C program testing). Is there something like this around?
- lmm 12y agoYou can get most of the value by keeping a VM with a minimal install of e.g. OpenBSD. SourceForge used to offer a cluster of various OSes where you could test your releases, I don't know if that's still running.
- masklinn 12y ago> Is there something like this around? Not that I'm aware, if you find it I'm interested.
- Zancarius 12y ago> Even testing it multiple posix-compatible and userland environments, you never really know whether your script actually is cross-platform. I think that's true for most software, though. Presumption is no replacement for testing...