分类:
2007-04-10 10:48:21
/****************************************************************************
home/lee#bash
/home/lee#array=(a b c) #定义一个数组array,用空格作为元素之间的分割符
/home/lee#echo ${#array[@]} #显示数组元素个数
3
/home/lee#echo ${array[1]} #显示某一元素
b
/home/lee#echo ${array[@]} #显示全部元素
a b c
/home/lee#array=($(date "+%Y %m %d")) #将一个命令的输出作为一个数组,下面同上
/home/lee#echo ${#array[@]}
3
/home/lee#echo ${array[@]}
2006 05 22
/home/lee#echo ${array[2]}
22
/home/lee#