I tried this answer to simulate a watch
without clear
:
while sleep 1; do ps -ef | grep convert | grep -v grep done
It leaves me with a greater-than symbol and the cursor next to it, nothing happens. Variants I tried that don’t work either:
while sleep 1; do ps -ef \| grep convert \| grep -v grep done
while sleep 1; do 'ps -ef | grep convert | grep -v grep' done
Why I want to do this: I want the results to be printed to standard output one below the next, and I do not want the line to be truncated to the window size.
;
before thedone
is missing, so the command is not finished and you get the>
prompt – Philippos Aug 15 '17 at 08:50ps
is to use a superfluous regular expression likegrep conver[t]
: This will match your desired line, but not thegrep
line itself! – Philippos Aug 15 '17 at 08:55