add zsh function loop-shell

This commit is contained in:
Martin Sekera 2020-09-22 10:38:26 +02:00
parent d3ef814b56
commit cc2c92bb77

View file

@ -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