I have the following
#!/bin/bash
aprograms=`pgrep a`
echo $aprograms
which outputs:
alejandro@ubuntu:~$ bash test.sh
2 6 7 8 12 13 16 17 20 27 ...
I want to control if there is a value inside $aprograms. I tryed the following (Which I dont know if its even a valid approach):
if [ $value in $aprograms ];then
echo "found"
But doesnt work. Is there a correct way to control if there is a value is inside $aprograms?