运行显示已使用 if else 语句创建警告横幅的脚本需要哪些命令?
例如:
If [something == something]
echo " Banners created"
else
echo "Banners not created"
echo " Details: "
echo $( /bin/ls -l /etc/motd)
答案1
if grep -q 'mywarning' /etc/motd; then
echo " Banners created"
else echo "Banners not created"
echo " Details: $(/bin/ls -l /etc/motd)"
fi