Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POSIX compliance; ok shells. #70

Closed
geoff-nixon opened this issue Dec 5, 2018 · 2 comments
Closed

POSIX compliance; ok shells. #70

geoff-nixon opened this issue Dec 5, 2018 · 2 comments
Labels

Comments

@geoff-nixon
Copy link

Couple things:

  • local is a bashism and definitely not POSIX. It doesn't exist in compliant shells like ksh, 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.
@whiteinge
Copy link
Owner

whiteinge commented Dec 5, 2018

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.

@whiteinge
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants