shell select良好的交互命令

#! /bin/bash
echo "choose your favorite color"
select color in "red" "black" "green" "yellow" "pink" "white"
do
	break
done
echo "you hava choosen color : $color"

 让用户输入参数列表

#! /bin/bash
echo "choose your favorite color"
select color 
do
	break
done
echo "you hava choosen color : $color"

 用法: ./xxx.sh  "red" "black" "green" "yellow" "pink" "white"

你可能感兴趣的:(shell select 交互)