mirror of
https://github.com/notwa/rc
synced 2025-02-05 07:43:22 -08:00
mostly superficial tweaks
This commit is contained in:
parent
dce787f082
commit
5ad06fcd63
4 changed files with 12 additions and 2 deletions
|
@ -4,6 +4,7 @@
|
|||
# YES_DASH
|
||||
# YES_ASH
|
||||
# YES_BB_AWK
|
||||
# YES_OT_AWK
|
||||
|
||||
countdiff() { ### @-
|
||||
### count the number of lines changed between two files.
|
||||
|
|
1
sh/dfu
1
sh/dfu
|
@ -4,6 +4,7 @@
|
|||
# YES_DASH
|
||||
# YES_ASH
|
||||
# YES_BB_AWK
|
||||
# YES_OT_AWK
|
||||
|
||||
dfu() { ### @-
|
||||
### pretty-print `df` in GiB.
|
||||
|
|
3
sh/oxo
3
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
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Add table
Reference in a new issue