Hi,
I am trying to print copy percentage completion dynamically by using the script below,
#!/bin/bash
dest_size=0
orig_size=`du -sk $sourcefile | awk '{print $1}'`
while [ $orig_size -gt $dest_size ] ; do
dest_size=`du -sk $destfile | awk '{print $1}'`
coyp_percentage=`echo "scale=2; $dest_size*100/$orig_size" | bc`
echo "$coyp_percentage"
sleep 1
done
From above code am getting completion percentage on newline as below,
.84
1.97
3.38
8.75
15.81
23.72
But I need the output on same line with space separated dynamically.
Any help on this..
Note: Do i need to use OFS for this?
OS_ver:Sol_11.3x86
shell=bash
TIA