The problem is simple.
for i in `seq $begin $progress_length` ; do
progress_bar=$progress_bar'#'
done
for i in `seq $middle $end` ; do
empty_space=$empty_space' '
done
I need empty_space
to position content after the progress bar. I've expected that it will be string of x whitespaces. But finally string is empty. How may I create string of x whitespaces?
The problem may be because $empty_space
has only spaces. Then, to output them you have to surround it in double quotes:
echo "${empty_space}some_other_thing"
You can try more interesting output with printf
for example to obtain several spaces. For instance, to write 20 spaces:
v=`printf '%20s' ' '`
The strings can be created using parameter substitution. The substitution ${str:offset:length} returns a substring of str :
space80=' '
hash80='################################################################################'
progress_bar=${hash80:0:$progress_length-$begin+1}
empty_space=${space80:0:$end-$middle+1}
echo -n "$empty_space$progress_bar"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With