title: Simulating a spinner for progress in Bash
body: <p>I am currently learning how to make scripts a bit more verbose. The below code shows a spinner. However, I am having difficulties modifying this spinner to have the words such as 'Downloading'. I want both the words and spinner to appear beside each other. I am not asking how to implement spinner for progress but how to concatenate with words. How could achieve this goal?</p>
  
  <pre><code>sp='/-\|'
  sc=0
  spin() {
     printf "\b${sp:sc++:1}"
     ((sc==${#sp})) &amp;&amp; sc=0
  }
  endspin() {
     printf "\r%s\n" "$@"
  }
  
  until work_done; do
     spin
     some_work ...
  done
  endspin
  </code></pre>