I have to test is the result of a command result with a 'command not found' string.
Let say that the command is :
If the system does not have the vgdisplay utilisty, it will display for ex :
./sysinfocollector: vgdisplay: command not found
What I want is to check if the result contain the string 'command not found' in the string below.
I have tested :
if ! [ vgdisplay -v 2>&1 | egrep -q 'command' ]; then
But that does not seems to work ...