如何删除变量中的多余空格?
VAR=" Eget ac vel volutpat dic tumst est dui adipiscing "
Correct result: VAR="Eget ac vel volutpat dic tumst est dui adipiscing"
有超过 16,000,000 个待编辑;sed
太慢了!
!!!编辑 !!!
字符串OK!谢谢你们
但
数组问题中的文本,仍然存在差距:-(
ITM=(" Eget ac vel volutpat | Vel volutpat dic tumst "
" Vestibulum laoreet a semper |orttitor eu laoreet justo congue ")
IFS=$'|'
for (( i=0 ; i<16000000 ; i++ ))
do
AAA=( ITM[$i] )
B=${AAA[0]} # " Eget ac vel volutpat "
C=${AAA[1]} # " Vel volutpat dic tumst "
done