2017-03-03 70 views
0

follwing显示脚本我想格式化输出将在shell脚本

echo "Starting of COUNT\n" 
       echo " PPDF    SIZE   FILENAME " 
       for i in `cat $Input_File` 
       do 
       find $i -name *.pdf |wc -l;cd $(echo $i |sed -n 's/.*\(\/pdf.*\)/\1/p');du -sm $(echo "$i"|cut -f 9 -d /).tar.gz; 
       done 

输出现在它显示为,COUNT的 启动 enter image description here

但我想要的输出应显示为列明智如下 enter image description here

+0

你试过'\ t'吗? –

回答

0

你的命令太吵了,以清楚指出的问题,但你可以看到你需要从下面的例子修复

$ echo -e "firts\t" | sed 's/ts/st/'; echo "second" 
first 
second 

$ echo -en "firts\t" | sed 's/ts/st/'; echo "second" 
first second 

在总结-n选项echo抑制新的生产线。