On Mon, 15 Nov 2021 20:13:01 +0300, misc@abrakadabra.systems wrote: > [/opt/bin]$ cat check.sh > #!/bin/sh > > _ret=$(ps aux | grep sleeploop.sh | grep -v grep | awk '{print $2}') > test -z ${_ret} && /opt/bin/sleeploop.sh &
By default, ps uses 80 columns so the information is probably being cut off. I'm guessing your interactive terminal is wider than 80 columns. You can add 'w' a few times to your ps options to extend the width but you are much better off using pgrep for this. - todd