Linux Shell 分割字符串 获取空格分隔的变量(以pid为例) set `ps|grep bash`;ehco $1 任意字符分隔(以_为例) text="aa_bb_cc" echo ${text%_*} #aa_bb echo