shell程序

例一:helloworld 

#!/bin/sh -x
message="hello"
read name
echo "$message ,$name"

 例二:选择性程序

#!/bin/sh
menu=("Apple" "Grape" "Orange")

PS3="喜欢哪个"

select item in ${menu[@]};do
  echo "喜欢$item"
done

 PS3是内置变量

posted @ 2015-02-26 09:24  kin2321  阅读(141)  评论(0编辑  收藏  举报