写了大概这么个东西,为了读 XML 文件并且加点东西:
#!/bin/sh
sed -n 's/.*>\(.*\)<\/name>/\1/p' test.xml|while read line
do
echo $line
echo $line:123456
done
结果输出时候单 echo $line 没有问题,但是第二个 echo , 123456 的部分覆盖掉了$line 的开头部分,求各位大大解答如何解决
#!/bin/sh
sed -n 's/.*>\(.*\)<\/name>/\1/p' test.xml|while read line
do
echo $line
echo $line:123456
done
结果输出时候单 echo $line 没有问题,但是第二个 echo , 123456 的部分覆盖掉了$line 的开头部分,求各位大大解答如何解决