/dev/null | grep "\-security" | wc -l)', $securityUpgrades); if (isset($securityUpgrades[0]) && intval($securityUpgrades[0]) > 0) { exec('apt list --upgradable 2>/dev/null | grep "\-security"', $securityUpgrades); // remove listening if (isset($securityUpgrades[1])) { unset($securityUpgrades[1]); } } // getting info of files exec('echo $(apt list --upgradable 2>/dev/null | grep -v "\-security" | wc -l)', $upgrades); if (isset($upgrades[0]) && intval($upgrades[0]) > 0) { exec('apt list --upgradable 2>/dev/null | grep -v "\-security"', $upgrades); // remove listening if (isset($upgrades[1])) { unset($upgrades[1]); } } echo (implode("\n", $upgrades)); } }