diff --git a/fake_home/.shell_aliases b/fake_home/.shell_aliases index c654384..5e784ed 100755 --- a/fake_home/.shell_aliases +++ b/fake_home/.shell_aliases @@ -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"