1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-11-05 06:39:02 -08:00

make grop its own shell script

This commit is contained in:
Connor Olding 2022-09-01 18:28:14 -07:00
parent 2c3ea77cf7
commit 1d0667c52b
2 changed files with 17 additions and 3 deletions

View file

@ -128,9 +128,6 @@ gdp() { ### @- invoke `gd` to diff a commit from its parent. the commit defaults
alias ash="PS1='$ ' busybox ash"
alias cort='LC_ALL=C sort'
alias grop='grep -oP' ### @- invoke grep with `-oP`.
### **NOTE:** there also exists a grop(1) program provided by
### the *grop* package that i don't use.
alias pip="maybesudo -H pip3"
alias revend='objcopy -I binary -O binary --reverse-bytes=4' ### @- reverse the 4-byte endianness of a single file. *this is an in-place operation!*
alias clone='maybesudo rsync -aHA --info=progress2 --no-i-r' ### @- invoke rsync suitably for creating virtually indistinguishable copies of files.

17
sh/grop Normal file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env sh
# YES_ZSH
# YES_BASH
# YES_DASH
# YES_ASH
# TODO: check for existence of grep -P; write a perl-based fallback.
grop() { ### @- invoke grep with `-oP`.
### **NOTE:** there also exists a grop(1) program provided by
### the *grop* package that i don't use.
argc $# -ge 1 grop || return
grep -oP -- "$@"
}
[ -n "${preload+-}" ] || . ~/sh/preload || exit 2
eval ${preload:-preload} argc
[ -n "${preload+-}" ] || grop "$@"