顯示具有 LINUX-Script 標籤的文章。 顯示所有文章
顯示具有 LINUX-Script 標籤的文章。 顯示所有文章

Script-case...esac範例

在螢幕上輸入『A』會出現『Apple』,輸入『B』會出現『Ball』,輸入其他則出現『Other』
# vim /etc/script
 case $1 in a)
  echo Apple;;
  b)
  echo Ball;;
  *)

  echo "請輸入A或B";;

 esac

執行script
# chmod 744 /etc/script
# /etc/script a
 Apple