Skip to content

Conversation

@loreb
Copy link

@loreb loreb commented Jun 11, 2021

It's 2 commits because I'm an idiot - I uploaded the new file using the browser, saw the option to create a new branch&PR
and, well, it turns out they meant a PR to myself...

Anyway, this should work with any POSIX shell (tested with dash, mksh, oksh, yash),
except that it uses "local" which, while technically non POSIX, is supported by every shell
(or at least I'm not aware of any shell that doesn't have it).

loreb added 2 commits June 9, 2021 23:24
The missing 1% is that POSIX doesn't have "local" or a __clean__ (non kludgy) equivalent.
Other than that I'm checking the return value of everything that could conceivably fail, except for `$(pwd)` which imho could be replaced by `$PWD`.

Autocompletion is commented out in case you use a non-bash shell which has autocompletion (OpenBSD's ksh at least)
and feel like translating that.
Translate to (99%) POSIX sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant