You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
366 B
Fish
23 lines
366 B
Fish
4 years ago
|
# Defined in /home/anton/.config/fish/functions/mwatch.fish @ line 2
|
||
|
function mwatch
|
||
|
argparse --name=mwatch -s 'n=' -- $argv
|
||
|
or return 1
|
||
|
|
||
|
set n "$_flag_n"
|
||
|
test -z "$n" -o "$n" -le 0; and set n 2
|
||
|
|
||
|
while true
|
||
|
set output (eval $argv)
|
||
|
|
||
|
clear
|
||
|
|
||
|
echo (date)" - refreshing every $n seconds"
|
||
|
|
||
|
for line in $output
|
||
|
echo $line
|
||
|
end
|
||
|
|
||
|
sleep "$n"
|
||
|
end
|
||
|
end
|