Reputation: 1317
I want to monitor my git log using a shell script but I cannot figure out how to send the q
key to kill LESS to continue the while loop. Here is what I have so far:
while :
do
clear
git log
sleep 1
done
I also tried:
while :
do
clear
git log
PID=$!
sleep 1
kill $PID
done
But, that second script has the same problem as the one before it, which is that the loop stops and waits for the git log (which is being shown through LESS) to quit.
How can I send a command to quit the git log so that it can refresh?
Upvotes: 1
Views: 132
Reputation: 1317
With @chepners help, here is the solution that works for me to monitor the log without the watch command:
while :
do
clear
git --no-pager log
sleep 1
done
Upvotes: 1