X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=528c3ee5bc801860fc0cb005a27e289c4e790d57;hb=a0cb586db00052329d1f3517dce39700ec0b0575;hp=8e88d418ec1b3e9e6b5b9b54f14141181894c51f;hpb=2550abc86968ff51ff7931aeebaf2980db428855;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 8e88d41..528c3ee 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -916,6 +916,20 @@ If you want to use xinit anyway please call \"/usr/bin/xinit\"." type -p fma &>/dev/null && alias ?='fma zshall' + # grep for running process, like: 'any vim' + any() { + if [ -z "$1" ] ; then + echo "any - grep for process(es) by keyword" >&2 + echo "Usage: any " >&2 ; return 1 + else + local STRING=$1 + local LENGTH=$(expr length $STRING) + local FIRSCHAR=$(echo $(expr substr $STRING 1 1)) + local REST=$(echo $(expr substr $STRING 2 $LENGTH)) + ps xauwww| grep [$FIRSCHAR]$REST + fi + } + # }}} # {{{ make sure our environment is clean regarding colors