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

python - How to add an model instance to a django queryset? -

Using Android Volley to post an array to PHP -

angularjs - No 'Access-Control-Allow-Origin' error from local domain to public API -