I'm keeping an eye on a process in FreeBSD using a script which outputs the current status of the job.
csh builtin command
repeat, I'd like to run the script every 2 seconds, so naively I'd like to do something like this:
repeat 100000 ./dumpstatus ; sleep 2
Obviously the semicolon won't work as intended, but I can't find the correct syntax to include it.
I can workaround by invoking a new shell instance under
repeat 100000 sh -c 'path/to/script/dumpstatus ; sleep 2'
but that's hardly ideal, and doesn't take a path from the current
pwd either which is annoying :)
I've also tried
repeat 10000 ( ./dumpstatus ; sleep 2) with and without escaping the brackets, that doesn't work either and I'm not completely sure why.
What is the correct way to do this, without invoking
sh -c, so the semicolon gets interpreted as I would wish?