For following these tutorials I'm trying to do something useful and have the following example:
pids=$(ps -C pidgin -o pid=) if [ -z $pids ]; then echo "have pids" $pids else echo "do not have pids" $pids fi
But I cannot validate the variable 'pids' even with "-n or -z or ! $pids" always prints the number of pidgin pids even in if or else condition Running on terminal show this:
bash: [: 2480: binary operator expected do not have pids 2480 20700
How can I property make this sentence work for this example?