5
rated 0 times
[
5]
[
0]
/ answers: 1 / hits: 3832
/ 2 Years ago, fri, february 4, 2022, 12:14:34
gnu watch
is a very useful tool for inspecting a program output: It executes the program and shows the output full-screen every 2 seconds.
Sometimes, I don't want the previous output to be erased, but rather be printed line by line with a time stamp. For that, I use bash scripts like:
while true;
do echo -n "`date` ";
ssh ubuntu@server -o ConnectTimeout=1 "uptime" ;
sleep 1;
done
Is there a watch
-like tool that can run a command and display its output with a timestamp in a line without erasing previous output?
More From » command-line