mirror of
https://github.com/notwa/rc
synced 2024-11-05 07:19:02 -08:00
14 lines
496 B
Bash
Executable file
14 lines
496 B
Bash
Executable file
#!/usr/bin/env sh
|
|
# compat: +ash +bash +dash +hush +ksh +mksh +oksh +osh +posh +yash +zsh
|
|
|
|
# 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
|
|
/usr/bin/env grep -oP -- "$@"
|
|
}
|
|
|
|
[ -n "${preload+-}" ] || . ~/sh/preload || exit 2
|
|
eval ${preload:-preload} argc
|
|
[ -n "${preload+-}" ] || grop "$@"
|