例一: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是内置变量