I'd like to see a run counter at the top of my
Ex: this command should print a count value which increments every 2 seconds, in addition to the output of my main command, which, in this case is just
echo "hello" for the purposes of this demonstration:
export COUNT=0 && watch -n 2 'export COUNT=$((COUNT+1)); echo "Count = $COUNT" \ && echo "hello"'
But, all it outputs is this, with the count always being 1 and never changing:
Count = 1 hello
How can I get this
Count variable to increment every 2 seconds when
watch runs the command?