1、cut 截取字符例子
str="GXyestacctbal_20140715_101_002716.unl"
substr=`echo "${str}" | cut -c 15-22`
echo "substr=${substr}"
2、
IP_PORTS="130.59.10.44:7065"
for str_ip_port in $IP_PORTS
do
flag=`echo $str_ip_port|awk '{print substr($1,1,1)}'`
if [ "${flag}" -eq "#" ]; then
continue
fi
ip=`echo $str_ip_port|awk -F":" '{print $1}'`
port=`echo $str_ip_port|awk -F":" '{print $2}'`desc=`echo $str_ip_port|awk -F":" '{print $3}'`
path=`echo $str_ip_port|awk -F":" '{print $4}'`
stopsh=`echo $str_ip_port|awk -F":" '{print $5}'`
startsh=`echo $str_ip_port|awk -F":" '{print $6}'`
down