How to show and update echo on same line

前端 未结 6 1317
陌清茗
陌清茗 2020-11-27 11:27

I have the following in Bash (In Linux)

for dir in Movies/*
do
  (cd \"$dir\" && pwd|cut -d \\/ -f5|tr -s \'\\n\' \', \' >> ../../movielist &am         


        
6条回答
  •  忘掉有多难
    2020-11-27 12:26

    You can try this.. My own version of it..

    funcc() {
    while true ; do 
    for i in \| \/ \- \\ \| \/ \- \\; do 
      echo -n -e "\r$1  $i  "
    sleep 0.5
    done  
    #echo -e "\r                                                                                      "
    [ -f /tmp/print-stat ] && break 2
    done
    }
    
    funcc "Checking Kubectl" & &>/dev/null
    sleep 5
    touch /tmp/print-stat
    echo -e "\rPrint Success                  "
    

提交回复
热议问题