POSIX compliance; ok shells.
Closed this issue · 2 comments
Couple things:
-
local
is a bashism and definitely not POSIX. It doesn't exist in compliant shells likeksh
,yash
, many others. Interestingly ok.sh is ok in oksh. -
The shebang is not POSIX, either, strictly speaking. You can begin a script with a colon instead.
ok.sh: line 200: local: not found
ok.sh: line 201: local: not found
ok.sh: line 202: local: not found
ok.sh: line 203: local: not found
ok.sh: line 204: local: not found
ok.sh: line 205: local: not found
ok.sh: line 206: local: not found
ok.sh: line 208: local: not found
ok.sh: line 154: local: not found
ok.sh: line 156: local: not found
No command given. Available commands:
$
toybox
is much more compliant than busybox, fwiw.
Hello. Thank you for taking the time to research these thoughts.
POSIX compatibility is a goal for ok.sh. The more broadly compatible the better, of course, but given the high level of fragmentation in this space we will necessarily have to strive for "good enough".
We acknowledge that local is not POSIX but have opted to use it anyway due to apparent broad support for the non-standard addition. I appreciate hearing your report of success in the oksh shell. What environment/OS/system are you wanting to use this script in where local is missing?
The shebang 'unspecified' note in the spec is indeed a long-standing curiosity. Are you suggesting that we use an alternative? If so, what are the pros/cons of doing so?
Toybox is a very compelling project with an interesting history. I have been watching its progress. At the time of this writing there are critical features needed by this script that are still in the 'Not started' phase. Most notably awk
.
Closing since I don't see anything actionable here. Please feel free to reopen or to file a new issue if there is a specific, commonly used environment where support for local
is missing.