shell - Bash print informations on the same point -



shell - Bash print informations on the same point -

in bash how can print informations on same point ???

for illustration how can if want loop on files in subdirectories of hypothetical root , want print on terminal informations on same location without printing new lines ??

dir example

--> root --> dir 1 --> file 1 --> file 2 --> dir 2 --> file 3 --> file 4

the shell output must thing :

infos before don't want clear ------------------------------- directory : dirname file count : x file : filename -------------------------------

"count" remain same in accord current dir other informations must changed in accord current subdir (element) of loop

thanks in advance

consider next example:

for file in * printf "\r%${columns}s\r%s" "" "$file" sleep 1 done echo

this prints files in current directory on same line, sleeping 1 sec after each filename.

in example, printf used print empty argument field width corresponds columns of terminal. clear previous output still in line before printing each new $file.

bash shell printf echo

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -