I've just come off the Winows wagon, and the gnome-terminal and bash are looking great, but I don't quite know how to get it to do what I want, (I suspect it is possible).
Can std output (eg. from sed) be made to run as a command?
(ie. interpret and run the output as part of the script's logic.)
I am polling a process to output its status at timed intervals, and I would like to do it as a one liner.
# dd is already running in another terminal. Its PID is 1234
pgrep -l '^dd$' | sed -n 's/^\([0-9]\+.*\)/sudo watch -n 30 kill -USR1 \1/p'
# this outputs: sudo watch 30 kill -USR1 1234
Is there some short-cut terminal/bash magic to run sudo watch 30 kill -USR1 1234
?
Thanks.