diff --git a/sh/argc b/sh/argc index 96b5c87..c528f9e 100755 --- a/sh/argc +++ b/sh/argc @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh argc() { ### @- validate the number of arguments in a function. ### ```sh diff --git a/sh/arith b/sh/arith index 9a930a7..77bf4eb 100755 --- a/sh/arith +++ b/sh/arith @@ -1,5 +1,5 @@ #!/usr/bin/env zsh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh # though technically compatible with other shells, # extra functionality is through zsh's extended arithmetic functions. diff --git a/sh/arrays b/sh/arrays index c71c311..6d8e7e3 100644 --- a/sh/arrays +++ b/sh/arrays @@ -1,5 +1,5 @@ #!/usr/bin/env false -# YES_ZSH YES_BASH NO_DASH NO_ASH +# compat: -ash +bash -dash +zsh whoa=( -Wall diff --git a/sh/askey b/sh/askey index 153cff8..e7bc849 100755 --- a/sh/askey +++ b/sh/askey @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh askey() { printf '\033[100m 00 \033[m \033[100m 01 \033[m \033[100m 02 \033[m \033[100m 03 \033[m \033[100m 04 \033[m \033[100m 05 \033[m \033[100m 06 \033[m \033[100m 07 \033[m \033[100m 08 \033[m \033[100m 09 \033[m \033[100m 0A \033[m \033[100m 0B \033[m \033[100m 0C \033[m \033[100m 0D \033[m \033[100m 0E \033[m \033[100m 0F \033[m diff --git a/sh/autosync b/sh/autosync index 81e806a..d4996bf 100755 --- a/sh/autosync +++ b/sh/autosync @@ -1,5 +1,5 @@ #!/usr/bin/env zsh -# YES_ZSH NO_BASH NO_DASH NO_ASH +# compat: -ash -bash -dash +zsh # TODO: portable way of dodging aliases to allow other shell support? diff --git a/sh/bak b/sh/bak index 3d79fe6..6b971f1 100755 --- a/sh/bak +++ b/sh/bak @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh bak() { ### @- ### backup files by creating copies and appending ".bak" to their names. diff --git a/sh/baknow b/sh/baknow index 9991615..ac1e451 100755 --- a/sh/baknow +++ b/sh/baknow @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh baknow() { ### @- backup files by appending their timestamps given by [`now`.](#now) ### ``` diff --git a/sh/baks b/sh/baks index bfacea9..d428d44 100755 --- a/sh/baks +++ b/sh/baks @@ -1,6 +1,6 @@ #!/usr/bin/env sh # backup, timestamped -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh baks() { ### @- ### backup files by copying each and appending *the current* date-time, diff --git a/sh/bin b/sh/bin index 169b951..2cdaf1c 100755 --- a/sh/bin +++ b/sh/bin @@ -1,5 +1,5 @@ #!/usr/bin/env zsh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh # though technically compatible with other shells, # extra functionality is through zsh's extended arithmetic functions. diff --git a/sh/burl b/sh/burl index 66c2469..c67b8b0 100755 --- a/sh/burl +++ b/sh/burl @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh burl() ( ### @- ### turn bash into a makeshift HTTP client. diff --git a/sh/busiest b/sh/busiest index 131185a..b230e79 100755 --- a/sh/busiest +++ b/sh/busiest @@ -1,5 +1,5 @@ #!/usr/bin/env zsh -# YES_ZSH NO_BASH NO_DASH NO_ASH +# compat: -ash -bash -dash +zsh busiest() { ### @- ### list directories in descending order by the number of files in them, diff --git a/sh/clash b/sh/clash index 57c46a5..46d50a0 100755 --- a/sh/clash +++ b/sh/clash @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh clash() { ### @- run a command through 12 different shells. ### only returns false when no arguments are given. diff --git a/sh/colors b/sh/colors index 28b44a6..e979bc6 100755 --- a/sh/colors +++ b/sh/colors @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# YES_ZSH YES_BASH NO_DASH NO_ASH +# compat: -ash +bash -dash +zsh colors() { ### @- ### display all combinations of foreground and background terminal colors. diff --git a/sh/colors2 b/sh/colors2 index 3a0b262..7a9e9e4 100755 --- a/sh/colors2 +++ b/sh/colors2 @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh colors2() { [ $# -eq 0 ] || { printf "%s\n" "$0: does not take arguments" >&2; return 1; } diff --git a/sh/compile b/sh/compile index 37976b1..775b542 100755 --- a/sh/compile +++ b/sh/compile @@ -1,5 +1,5 @@ #!/usr/bin/env zsh -# YES_ZSH NO_BASH NO_DASH NO_ASH +# compat: -ash -bash -dash +zsh setup_clang_ubuntu() { ### @- ### print (but don't execute) the commands necessary to install diff --git a/sh/confirm b/sh/confirm index 6915823..56de0c7 100755 --- a/sh/confirm +++ b/sh/confirm @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh ### @ confirm ### display a simple yes-or-no prompt and return 0-or-1 respectively. diff --git a/sh/countdiff b/sh/countdiff index 04e8418..0dbdc06 100755 --- a/sh/countdiff +++ b/sh/countdiff @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH YES_BB_AWK YES_OT_AWK +# compat: +ash +bash +dash +zsh YES_BB_AWK YES_OT_AWK countdiff() { ### @- ### count the number of lines changed between two files. diff --git a/sh/cutv b/sh/cutv index 388c60c..0f5c44a 100755 --- a/sh/cutv +++ b/sh/cutv @@ -1,5 +1,5 @@ #!/usr/bin/env zsh -# YES_ZSH NO_BASH NO_DASH NO_ASH +# compat: -ash -bash -dash +zsh cutv() { argc $# -ge 2 "$0" || return diff --git a/sh/dated b/sh/dated index 350c6f5..afab5d5 100755 --- a/sh/dated +++ b/sh/dated @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh dated() { local ts= u=0 diff --git a/sh/days b/sh/days index 1dc31a5..18ada23 100755 --- a/sh/days +++ b/sh/days @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh days() { ### @- ### compute the number of days since a given date. diff --git a/sh/decently b/sh/decently index d95527c..389101a 100755 --- a/sh/decently +++ b/sh/decently @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh # TODO: check if this is compatible with busybox. diff --git a/sh/dedupe b/sh/dedupe index 78ade4f..a4e344d 100755 --- a/sh/dedupe +++ b/sh/dedupe @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh dedupe() ( ### @- copy a directory, but make hard/softlinks for identical files. # Copyright (C) 2022 Connor Olding diff --git a/sh/dfu b/sh/dfu index e6465dd..7828125 100755 --- a/sh/dfu +++ b/sh/dfu @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH YES_BB_AWK YES_OT_AWK +# compat: +ash +bash +dash +zsh YES_BB_AWK YES_OT_AWK dfu() { ### @- ### pretty-print `df` in GiB. diff --git a/sh/disowned b/sh/disowned index 0d6cd00..16b1fe6 100755 --- a/sh/disowned +++ b/sh/disowned @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh disowned() { ### @- find files in system directories that aren't associated with any pacman packages. # diff --git a/sh/e b/sh/e index 671fc9c..fe84284 100755 --- a/sh/e +++ b/sh/e @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH YES_BB_AWK +# compat: +ash +bash +dash +zsh YES_BB_AWK e() { ### @- ### wrap around `$EDITOR` to run it as root if necessary. diff --git a/sh/ea b/sh/ea index 4a9cfd5..ac582e3 100755 --- a/sh/ea +++ b/sh/ea @@ -1,6 +1,6 @@ #!/usr/bin/env sh # remote file access (http file-sharing shenanigans) -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh __ea_curl() { curl -q --no-progress-meter 127.255.255.255 >/dev/null 2>&1 diff --git a/sh/echo2 b/sh/echo2 index d705944..5dd7a12 100755 --- a/sh/echo2 +++ b/sh/echo2 @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh echo2() { ### @- ### print arguments joined by spaces to stderr without parsing anything. diff --git a/sh/explore b/sh/explore index 5801dd4..8175647 100755 --- a/sh/explore +++ b/sh/explore @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh explore() { ### @- open a single directory in `explorer.exe`, defaulting to `$PWD`. [ -n "$MSYSTEM" ] || { printf "%s\n" "$0: only for MSYS2" >&2; return 1; } diff --git a/sh/feud b/sh/feud index ffdfdd9..c2d70b8 100755 --- a/sh/feud +++ b/sh/feud @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh ### @feud - parse command-line arguments, mapping short-flags to variable names. ### **NOTE:** the API is still experimental and will undergo major changes. diff --git a/sh/ff b/sh/ff index efef09c..5086410 100755 --- a/sh/ff +++ b/sh/ff @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh ff() { ### @- ### select a file from a given or current directory using diff --git a/sh/ghmd b/sh/ghmd index d895358..dc2bcbb 100755 --- a/sh/ghmd +++ b/sh/ghmd @@ -2,7 +2,7 @@ # ghmd - format GitHub markdown # via: https://leahneukirchen.org/dotfiles/.zshrc # example: ghmd < README.md > README.html -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh ghmd() { ### @- ### convert a markdown file to HTML in the style of GitHub. diff --git a/sh/glug b/sh/glug index f60a635..2a59c69 100755 --- a/sh/glug +++ b/sh/glug @@ -1,5 +1,5 @@ #!/usr/bin/env dash -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh # fuck termcap, all my homies hate termcap. glug() ( # note the subshell syntax. this allows us to abuse globals like crazy. diff --git a/sh/grab b/sh/grab index 20a81c7..12b644e 100755 --- a/sh/grab +++ b/sh/grab @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh __grab() { ### @grab - download a file from my site and verify its integrity by its [minisign](https://github.com/jedisct1/minisign/) signature. [ -z "${ZSH_VERSION}" ] || emulate sh diff --git a/sh/grop b/sh/grop index e1c0bd6..0392b7c 100755 --- a/sh/grop +++ b/sh/grop @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh # TODO: check for existence of grep -P; write a perl-based fallback. grop() { ### @- invoke grep with `-oP`. diff --git a/sh/grop4 b/sh/grop4 index 756abe7..478c7ee 100755 --- a/sh/grop4 +++ b/sh/grop4 @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh grop4() { ### @- [`grop`](#grop) for IPv4s. grep -oP -- '(?<=^|[^\d.])((0|1\d\d|2[0-4]\d|25[0-5]|[1-9]\d?)\.((?2))\.((?2))\.((?2)))(?=$|[^\d.])' diff --git a/sh/has b/sh/has index ffa3c51..c9ec9ae 100755 --- a/sh/has +++ b/sh/has @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh has() { ### @- [`have`,](#have) silently. if [ -z "$ZSH_VERSION" ]; then which -- "$1"; else whence -p -- "$1"; fi diff --git a/sh/have b/sh/have index 45e3690..d3d9d9f 100755 --- a/sh/have +++ b/sh/have @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh have() { ### @- print the result of `which` if the program is found, else simply return 1. ### ``` diff --git a/sh/hex b/sh/hex index 2e4c8b3..0ba6b4f 100755 --- a/sh/hex +++ b/sh/hex @@ -1,5 +1,5 @@ #!/usr/bin/env zsh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh # though technically compatible with other shells, # extra functionality is through zsh's extended arithmetic functions. diff --git a/sh/ify b/sh/ify index 83307a6..d3982b7 100755 --- a/sh/ify +++ b/sh/ify @@ -1,5 +1,5 @@ #!/usr/bin/sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh ify() { ### @- ### pipe one command through another, so you can still pass arguments to the former. diff --git a/sh/is_empty b/sh/is_empty index 3b41a3c..5b8dde3 100755 --- a/sh/is_empty +++ b/sh/is_empty @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# YES_ZSH YES_BASH NO_DASH NO_ASH +# compat: -ash +bash -dash +zsh is_empty() { ### @- ### return 0 if the directory given by argument is empty. diff --git a/sh/isup b/sh/isup index 0122bc6..0fd2789 100755 --- a/sh/isup +++ b/sh/isup @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh isup() { ### @- ### return 0 if a given website returns a 2xx HTTP code. diff --git a/sh/join2 b/sh/join2 index 3ac8743..c29ba3a 100755 --- a/sh/join2 +++ b/sh/join2 @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh join2() { ### @- join every other line. # TODO: argc, also better interface that allows n file inputs without stdin. diff --git a/sh/lsarchive b/sh/lsarchive index dfa54c0..5fdbfc9 100755 --- a/sh/lsarchive +++ b/sh/lsarchive @@ -1,5 +1,5 @@ #!/usr/bin/env zsh -# YES_ZSH NO_BASH NO_DASH NO_ASH +# compat: -ash -bash -dash +zsh lsarchive() { ### @- list the contents of an archive file in one of many formats. ### borrowed from [prezto.](https://github.com/sorin-ionescu/prezto) diff --git a/sh/maybesudo b/sh/maybesudo index c592891..c4953eb 100755 --- a/sh/maybesudo +++ b/sh/maybesudo @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh __maybesudo() { ### @maybesudo ### mimic certain features of `sudo` for systems without it installed. diff --git a/sh/minutemaid b/sh/minutemaid index 27f4243..df31c20 100755 --- a/sh/minutemaid +++ b/sh/minutemaid @@ -1,5 +1,5 @@ #!/usr/bin/env dash -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh minutemaid() { ### @- ### check if the current minute is divisible by a given number, diff --git a/sh/monitor b/sh/monitor index 715cc93..a553951 100755 --- a/sh/monitor +++ b/sh/monitor @@ -1,5 +1,5 @@ #!/usr/bin/env zsh -# YES_ZSH NO_BASH NO_DASH NO_ASH +# compat: -ash -bash -dash +zsh monitor() { ### @- ### this is [watch(1)](https://www.man7.org/linux/man-pages/man1/watch.1.html) diff --git a/sh/morecolors b/sh/morecolors index 46acc0a..9948e07 100755 --- a/sh/morecolors +++ b/sh/morecolors @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# YES_ZSH YES_BASH NO_DASH NO_ASH +# compat: -ash +bash -dash +zsh morecolors() { ### @- print all 256 colors that are available on most terminals. # borrowed from leah2's dotfiles. diff --git a/sh/noccom b/sh/noccom index 859e5da..0d3779b 100755 --- a/sh/noccom +++ b/sh/noccom @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh # TODO: what's the minimum version of perl required for this? diff --git a/sh/note b/sh/note index 0d514a3..644f47d 100755 --- a/sh/note +++ b/sh/note @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh note() { ### @- ### act like [`echo2`,](#echo2) but use a bright color to stand out more. diff --git a/sh/notice b/sh/notice index f46faa4..6fb3dd6 100755 --- a/sh/notice +++ b/sh/notice @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh __notice_warn() { printf >&2 'notice: %s\n' "$*" diff --git a/sh/now b/sh/now index 3647556..1c8a1d6 100755 --- a/sh/now +++ b/sh/now @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh now() { ### @- ### print a date-time (UTC) in a sortable format. diff --git a/sh/oshi b/sh/oshi index 5a3daed..70dc62d 100755 --- a/sh/oshi +++ b/sh/oshi @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh __oshi() { ### @oshi ### upload files (or stdin) to [oshi.at.](https://oshi.at) diff --git a/sh/oxo b/sh/oxo index 797c8be..f55d466 100755 --- a/sh/oxo +++ b/sh/oxo @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh # **TL;DR RULES:** # * no executables (for the most part) diff --git a/sh/pacbm b/sh/pacbm index 8eba7b9..d0990c4 100755 --- a/sh/pacbm +++ b/sh/pacbm @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh # TODO: does this work with busybox awk? diff --git a/sh/pause b/sh/pause index 7f79cec..5587405 100755 --- a/sh/pause +++ b/sh/pause @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh ### @ pause ### pause — the companion script of [`confirm`.](#confirm) diff --git a/sh/pegg b/sh/pegg index 41019ca..2d04b98 100755 --- a/sh/pegg +++ b/sh/pegg @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh pegg() { ### @- ### download and (pip) install a Python "egg" from a project on GitHub, diff --git a/sh/permit b/sh/permit index 041c5b4..979a016 100755 --- a/sh/permit +++ b/sh/permit @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh __permit_hex() { if xxd -l 0 2>/dev/null; then diff --git a/sh/pippy b/sh/pippy index b2acd40..2b0d29c 100755 --- a/sh/pippy +++ b/sh/pippy @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh pippy() { ### @- ### install Python packages using pip, diff --git a/sh/pre b/sh/pre index 2ca1dd9..fb425ad 100755 --- a/sh/pre +++ b/sh/pre @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh pre() { ### @- ### dump all the `#define`s that `$CC $CPPFLAGS $CFLAGS $LDFLAGS` would result in. diff --git a/sh/psbm b/sh/psbm index b478169..5ef8969 100755 --- a/sh/psbm +++ b/sh/psbm @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH YES_BB_AWK +# compat: +ash +bash +dash +zsh YES_BB_AWK psbm() { ### @- ### display and order processes by their memory usage ascending, and their sum. diff --git a/sh/randir b/sh/randir index eaf483c..95683b2 100755 --- a/sh/randir +++ b/sh/randir @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh # works with busybox. diff --git a/sh/recolor b/sh/recolor index b2cd5ad..fe1ff0b 100755 --- a/sh/recolor +++ b/sh/recolor @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh __recolor_install() { ForegroundColour() { recolor RAW 10 "$@"; } diff --git a/sh/rot13 b/sh/rot13 index 84b968a..613b814 100755 --- a/sh/rot13 +++ b/sh/rot13 @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh # works with busybox tr. diff --git a/sh/rs b/sh/rs index 25efb21..103b960 100755 --- a/sh/rs +++ b/sh/rs @@ -1,5 +1,5 @@ #!/usr/bin/env zsh -# YES_ZSH NO_BASH NO_DASH NO_ASH +# compat: -ash -bash -dash +zsh rs() { ### @- ### record screen. does not record audio. diff --git a/sh/running b/sh/running index 5201ecf..3d6f3a2 100755 --- a/sh/running +++ b/sh/running @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH YES_BB_AWK +# compat: +ash +bash +dash +zsh YES_BB_AWK # probably not compatible with busybox ps because its column 2 isn't PID. diff --git a/sh/scount b/sh/scount index 83c1a4f..2357d53 100755 --- a/sh/scount +++ b/sh/scount @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh ### @ scount ### perform `sort | uniq -c | sort -n`, preferring GNU awk when available. diff --git a/sh/scramble b/sh/scramble index a613880..3b487ec 100755 --- a/sh/scramble +++ b/sh/scramble @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh # does not work with busybox sed (yet?) diff --git a/sh/scropt b/sh/scropt index b147fe2..474e506 100755 --- a/sh/scropt +++ b/sh/scropt @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh scropt() { ### @- ### run `scrot` through `optipng` and save the result to `~/play/$(now).png`. diff --git a/sh/shcom b/sh/shcom index 0e74e44..1260f28 100755 --- a/sh/shcom +++ b/sh/shcom @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh shcom() { ### @- ### comment out text from stdin and wrap it in a markdown blockquote diff --git a/sh/similar b/sh/similar index 22dcaa7..eacc481 100755 --- a/sh/similar +++ b/sh/similar @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH YES_BB_AWK +# compat: +ash +bash +dash +zsh YES_BB_AWK similar() { ### @- ### highlight adjacent lines up to the first inequivalent character. diff --git a/sh/slit b/sh/slit index 86c59b9..abc9d1b 100755 --- a/sh/slit +++ b/sh/slit @@ -1,5 +1,5 @@ #!/usr/bin/env dash -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh # works with busybox ash. diff --git a/sh/slitt b/sh/slitt index abb4862..381437e 100755 --- a/sh/slitt +++ b/sh/slitt @@ -1,5 +1,5 @@ #!/usr/bin/env dash -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh # works with busybox ash. diff --git a/sh/sortip b/sh/sortip index 28708cd..c1130ca 100755 --- a/sh/sortip +++ b/sh/sortip @@ -1,5 +1,5 @@ #!/usr/bin/sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh sortip() { ### @- sort lines numerically by IPv4 segments. sort -t . -k 1,1n -k 2,2n -k 3,3n -k 4,4n "$@" diff --git a/sh/sram b/sh/sram index 4640f8c..72b9a3d 100755 --- a/sh/sram +++ b/sh/sram @@ -1,5 +1,5 @@ #!/usr/bin/env zsh -# YES_ZSH YES_BASH NO_DASH NO_ASH +# compat: -ash +bash -dash +zsh sram() { ### @- ### convert between a couple saveram formats for N64 emulators. diff --git a/sh/stfu b/sh/stfu index 5fca20c..0a8abc7 100755 --- a/sh/stfu +++ b/sh/stfu @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh stfu() { ### @- ### invoke a command, silencing stdout and stderr *unless* the command fails. diff --git a/sh/streamcrap b/sh/streamcrap index b1898e9..ba6396f 100644 --- a/sh/streamcrap +++ b/sh/streamcrap @@ -1,6 +1,6 @@ #!/usr/bin/env false # awful things -# YES_ZSH YES_BASH NO_DASH NO_ASH +# compat: -ash +bash -dash +zsh mpvs() { mpv --quiet \ diff --git a/sh/subdue b/sh/subdue index 1d1d608..94031ac 100755 --- a/sh/subdue +++ b/sh/subdue @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh __subdue() { ### @subdue ### reconfigure your terminal's color scheme using a preset for [recolor.](#recolor) diff --git a/sh/sum b/sh/sum index 2fe77ff..522ecd2 100755 --- a/sh/sum +++ b/sh/sum @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh sum() { ### @- ### compute the summation of its arguments without forking processes. diff --git a/sh/sv b/sh/sv index 94f5d5a..44ef5c9 100755 --- a/sh/sv +++ b/sh/sv @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH YES_BB_AWK +# compat: +ash +bash +dash +zsh YES_BB_AWK sv() { ### @- ### collect the lastmost value of every key. diff --git a/sh/trash b/sh/trash index d7994b7..ae73451 100755 --- a/sh/trash +++ b/sh/trash @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh trash() { ### @- ### output a given number of bytes from `/dev/random`. diff --git a/sh/trunc b/sh/trunc index 0930f2e..8105bc1 100755 --- a/sh/trunc +++ b/sh/trunc @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH YES_BB_AWK +# compat: +ash +bash +dash +zsh YES_BB_AWK trunc() { ### @- ### truncate text to fit within your terminal using the unicode character `…`. diff --git a/sh/unarchive b/sh/unarchive index 288a964..f58d5a0 100755 --- a/sh/unarchive +++ b/sh/unarchive @@ -1,5 +1,5 @@ #!/usr/bin/env zsh -# YES_ZSH NO_BASH NO_DASH NO_ASH +# compat: -ash -bash -dash +zsh unarchive() { ### @- extract the contents of an archive file in one of many formats. ### borrowed from [prezto.](https://github.com/sorin-ionescu/prezto) diff --git a/sh/unwrap b/sh/unwrap index 23422a2..a9ab553 100755 --- a/sh/unwrap +++ b/sh/unwrap @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh unwrap() { ### @- join paragraphs into one line each. awk '\''BEGIN{RS="\n\n";FS="\n"}{for(i=1;i<=NF;i++)printf "%s ",$i;print "\n"}'\' diff --git a/sh/v_domap b/sh/v_domap index d52fe42..227948a 100644 --- a/sh/v_domap +++ b/sh/v_domap @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh v_domap() { argc $# -eq 1 "$0" || return diff --git a/sh/v_lower b/sh/v_lower index f5ddbf9..0479f99 100644 --- a/sh/v_lower +++ b/sh/v_lower @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh v_lower() { ### @- transform the contents of a variable to lowercase. argc $# -eq 1 "$0" || return diff --git a/sh/v_upper b/sh/v_upper index 0a889ab..d787215 100644 --- a/sh/v_upper +++ b/sh/v_upper @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh v_upper() { ### @- transform the contents of a variable to uppercase. argc $# -eq 1 "$0" || return diff --git a/sh/wat b/sh/wat index d386805..bfae5d3 100755 --- a/sh/wat +++ b/sh/wat @@ -1,5 +1,5 @@ #!/usr/bin/env zsh -# YES_ZSH NO_BASH NO_DASH NO_ASH +# compat: -ash -bash -dash +zsh # wat - a better and recursive which/whence # via: https://leahneukirchen.org/dotfiles/tools.html diff --git a/sh/wipe b/sh/wipe index c414cd5..e6a3913 100755 --- a/sh/wipe +++ b/sh/wipe @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH YES_BB_AWK +# compat: +ash +bash +dash +zsh YES_BB_AWK wipe() { ### @- ### clear the screen and its scrollback, then print a high-contrast horizontal line. diff --git a/sh/xxp b/sh/xxp index 06e082a..cea9b5b 100755 --- a/sh/xxp +++ b/sh/xxp @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# YES_ZSH YES_BASH YES_DASH YES_ASH +# compat: +ash +bash +dash +zsh xxp() { ### @- ### act like `xxd -p`, but nicely formatted.