How to display and refresh multiple lines in bash

后端 未结 5 797
孤独总比滥情好
孤独总比滥情好 2020-12-14 21:49

I am writing a installation script and would like to display the status of the script as it progresses.

example:

var1=\"pending\"
var2=\"pending\"
va         


        
5条回答
  •  隐瞒了意图╮
    2020-12-14 22:07

    Look at this:

    while true; do echo -ne "`date`\r"; done
    

    and this:

    declare arr=(
      ">...."
      ".>..."
      "..>.."
      "...>."
      "....>"
    )
    
    for i in ${arr[@]}
    do
      echo -ne "${i}\r"
      sleep 0.1
    done
    

提交回复
热议问题