I try to make a script for macOS that informs me about available software updates:
result=$(softwareupdate -l)
if [[ $(echo $result) = *"No new software available."* ]]; then say yes;fi
But the important line isn't included. Result:
result=$(softwareupdate -l)
softwareupdate -l
++ softwareupdate -l
No new software available.
+ result='Software Update Tool
Finding available software'
if [[ $(echo $result) = *"No new software available."* ]]; then say yes;fi
echo $result
++ echo Software Update Tool Finding available software
+ [[ Software Update Tool Finding available software = *\N\o\ \n\e\w\ \s\o\f\t\w\a\r\e\ \a\v\a\i\l\a\b\l\e\.* ]]
The line: "No new software available." is not included in the variable. Why?