0xtiago / qualysapi

qualysapi is a simple API Qualys client written in shell script 🐧.
GNU General Public License v3.0
2 stars 1 forks source link

Add a spinner on waiting functions #10

Closed 0xtiago closed 1 year ago

0xtiago commented 1 year ago

Talvez uma boa solução.

https://stackoverflow.com/questions/12498304/using-bash-to-display-a-progress-indicator

/usr/bin/scp me@website.com:file somewhere 2>/dev/null &
pid=$! # Process Id of the previous running command

spin='-\|/'

i=0
while kill -0 $pid 2>/dev/null
do
  i=$(( (i+1) %4 ))
  printf "\r${spin:$i:1}"
  sleep .1
done