Command Line If Output Of Command Is Equal To String

[Solved] Command Line If Output Of Command Is Equal To String | Basic - Code Explorer | yomemimo.com
Question : command line if output of command is equal to string

Answered by : rich-raccoon-nj9y4fw6g9jo

if [[ $(< your command giving output >) = *< substring to match >* ]]; then < your command if the substring is found anywhere in the output >
fi

Source : https://unix.stackexchange.com/questions/52800/how-to-do-an-if-statement-from-the-result-of-an-executed-command | Last Update : Tue, 08 Jun 21

Answers related to command line if output of command is equal to string

Code Explorer Popular Question For Basic