From cc2c92bb77e8d5c9a7857127402853a2426ed39c Mon Sep 17 00:00:00 2001 From: Martin Sekera Date: Tue, 22 Sep 2020 10:38:26 +0200 Subject: [PATCH] add zsh function loop-shell --- etc/zsh/zshrc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index db5f7cc..0099df9 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -87,7 +87,7 @@ psg () { ps axu | grep -v grep | grep -i $* } # hledání v běžících procese pskill () { pids=($(psg $1|awk '{print $2}')) - + for pid in $pids; do echo "Killing $pid..." kill $pid @@ -174,6 +174,17 @@ function mkvoid () { rm -rf "${__MKVOID_ID}" || die "rm void" } +# loop-shell COMMAND creates a shell that takes user_input and runs COMMAND user_input +# e.g. "loop-shell grep -ri" creates a grepping shell +function loop-shell { + while true + do + echo -n "-> " + read Q + $@ $Q + done +} + # history including search HISTFILE=~/.history HISTSIZE=10000000