I have following command output
$ /opt/CrowdStrike/falconctl -g --aid | grep 'aid='
aid="fdwe234wfgrgf34tfsf23rwefwef3".
I want to check if there is any string after aid= (inside ""). If there is any string, command return code should be 0 and if no value return code must be !=0.
Can someone please help to extend this command to get required output?
Idea is to make sure my bash script to fail if aid= doesn't has any value.
grep -q, which has exactly the exit status behaviour you describe:falconctl -g aid | grep -q 'aid="[^"]*YOURSTRING[^"]*"'falconctl ... | grep -q 'aid="..*"'might be what you want.aid=""?aid=? something else?