I have a noobish problem with a bash script. It treats a string as command.
Script is
#!/bin/bash
if ["$(pidof whatever)"]
then
echo "suicide"
fi
exit 0
The error I get at run is "[29999] command is not found".
Ty for your help and time.
You need a space between [ and $. [ is test command.
#!/bin/bash
if [ $(pidof whatever) ]
then
echo "suicide"
fi
exit 0
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