echo不换行输出实现进度条
输出:[root@lsplinux1 temp]# ../../../1_mkfep.sh265523 blocksROOTFS-AXM.cpio.xz already exist in /home/xiatian/debug_fix/lfs, remove it before generate .cpio.xz!!!................................
·
#!/bin/bash
CPIO_FILE_XZ="ROOTFS.cpio.xz"
progress()
{
while true;
do
echo -e "=\c" #echo的参数中, -e表示开启转义, /c表示不换行
sleep 1
done
}
find * -depth -print | cpio -H newc -o > ../ROOTFS.cpio
cd ..
if [ -f $CPIO_FILE_XZ ]; then
echo "ROOTFS.cpio.xz already exist in `pwd`, remove it before generate .cpio.xz!!!"
rm $CPIO_FILE_XZ
fi
progress &
pidback=$!
xz -z ROOTFS.cpio
if mkfep -k ROOTFS.cpio.xz ROOTFS.FEP ; then
echo 'FEP generated!!'
echo "`pwd`/ROOTFS.FEP"
fi
kill -9 $pidback
exit $?
输出:
[root@linux1 temp]# mkfep.sh
265523 blocks
ROOTFS.cpio.xz already exist in /home/xiatian/, remove it before generate .cpio.xz!!!
=======================================================================FEP generated!!
/home/xiatian/ROOTFS.FEP
更多推荐
已为社区贡献3条内容
所有评论(0)