Add ungrep and helpdef
This commit is contained in:
parent
5edca3e99a
commit
7fe5811cce
|
@ -9,6 +9,15 @@ else
|
|||
fi
|
||||
|
||||
alias _slides="$(which slides 2> /dev/null || echo "echo 'slides not installed'")"
|
||||
|
||||
function helpdef {
|
||||
if [[ "$1" == "--help" ]] || [[ "$1" == "-h" ]]; then
|
||||
echo "$2"
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
function slides() {
|
||||
OLD_PATH="$PATH"
|
||||
PATH="$HOME/.slides-bin:$PATH"
|
||||
|
@ -64,6 +73,15 @@ function hearch {
|
|||
history 0 | sed 's/[0-9 ]*//' | grep "$@"
|
||||
}
|
||||
|
||||
function ungrep {
|
||||
helpdef "$1" "grep -v's all arguments from the piped input" && return 0
|
||||
local output="$(cat)"
|
||||
for arg in "$@"; do
|
||||
output="$(echo "$output" | grep -v "$arg")"
|
||||
done
|
||||
echo "$output"
|
||||
}
|
||||
|
||||
function kubelog {
|
||||
local pods="$(kubectl get pods | grep "$1")"
|
||||
local selection="1"
|
||||
|
|
Loading…
Reference in New Issue