diff --git a/sh/countdiff b/sh/countdiff index 2f11394..8140a13 100755 --- a/sh/countdiff +++ b/sh/countdiff @@ -4,6 +4,7 @@ # YES_DASH # YES_ASH # YES_BB_AWK +# YES_OT_AWK countdiff() { ### @- ### count the number of lines changed between two files. @@ -18,7 +19,7 @@ countdiff() { ### @- [ $# -gt 1 ] || { printf "%s\n" "$0: too few arguments" >&2; return 1; } [ $# -le 2 ] || { printf "%s\n" "$0: too many arguments" >&2; return 1; } git --no-pager diff --stat --no-color --no-index "$1" "$2" \ - | awk '/changed/{print $4+$6;a=1}END{if(!a)print 0}' + | awk ' /changed/{print $4+$6;a=1}END{if(!a)print 0}' } [ -n "${preload+-}" ] || countdiff "$@" diff --git a/sh/dfu b/sh/dfu index 6ba9c95..5a13620 100755 --- a/sh/dfu +++ b/sh/dfu @@ -4,6 +4,7 @@ # YES_DASH # YES_ASH # YES_BB_AWK +# YES_OT_AWK dfu() { ### @- ### pretty-print `df` in GiB. diff --git a/sh/oxo b/sh/oxo index 99f1795..d989669 100755 --- a/sh/oxo +++ b/sh/oxo @@ -25,6 +25,7 @@ oxo() { ### @- ### $ echo test | oxo ### https://0x0.st/sj2.txt ### oxo: successfully uploaded 1/1 file + ### ### $ oxo ~/play/{hey,you,fake,empty} ### https://0x0.st/-3rz.txt ### oxo: expires in 365 days: /home/notwa/play/hey @@ -67,7 +68,7 @@ oxo() { ### @- # restrict the filepath to simple ascii characters that curl likes. if [ "$f" != "${f#*[! -~]}" ] || [ "$f" != "${f#*[\":<>?\\|]}" ]; then # copy the user's file to a temporary path and use that instead. - g=/tmp/oxo + g=/tmp/oxo.tmp #printf "$warn" "oxo: special characters found: $f" >&2 if ! cp -p -- "$f" "$g"; then printf "$bad" "oxo: failed to copy file: $f" >&2 diff --git a/sh/running b/sh/running index 9eb0e6a..a6589bb 100755 --- a/sh/running +++ b/sh/running @@ -18,6 +18,13 @@ running() { ### @- WIP (*) printf '%s\n' "$usage" >&2; return 2;; esac done + + # ps -o pid,comm=CMD + # argumentless flags accepted by busybox: + # a d e f l A T Z + # argumentless flags accepted by coreutils: + # a c d e f g h j l m n r s t u v w x A F H L M N P S T V X Z + ps -f | awk -v cmd=$cmd -v pid=$pid ' NR==1{ s=index($0,"COMMAND")