I would like that if this command outputs anything
find /var/www/cgi-bin -name touch -cmin 10
then should "ok" be echoed.
Have tried
if [ $(find /var/www/cgi-bin -name touch -cmin 10) ]; then echo "ok";fi
but it never echoes anything.
Put double quotes around $(..)
:
if [ "$(find /var/www/cgi-bin -name touch -cmin 10)" ]; then echo "ok"; fi
This will interpret the output of find
as a single word.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With