| 1 | # oil-polyfill.sh
|
| 2 | #
|
| 3 | # Portable shell for some of Oil's builtins.
|
| 4 | #
|
| 5 | # Usage:
|
| 6 | # source oil-polyfill.sh
|
| 7 |
|
| 8 | sh-strict() {
|
| 9 | ### Turn on "legacy" shell strict modes.
|
| 10 |
|
| 11 | # bash has this option, which is similar.
|
| 12 | # use || true in case
|
| 13 | # Actually we don't need this because of static-word-eval subsumes it?
|
| 14 | #shopt -s nullglob 2>/dev/null || true
|
| 15 |
|
| 16 | # POSIX
|
| 17 | set -o errexit -o nounset -o pipefail
|
| 18 |
|
| 19 | # shopt
|
| 20 | }
|
| 21 |
|
| 22 | # Idea: from Soil, to fix Bernstein chaining.
|
| 23 | #
|
| 24 | # ssh $USER@$HOST "$(printf '%q ' "$@")"
|
| 25 | #
|
| 26 | # Also need one for scp.
|
| 27 |
|
| 28 | # Idea: from tea/run.sh, exit 255 for xargs
|
| 29 | # Does this need run --assign-status, or can it be POSIX shell?
|