I am writing a little script to handle folders. The runtime is quite long, so I would like to add a progress bar.
Here is the iteration:
for file in */ do
Having a counter and knowing the number of folders is the solution. But I'm looking for a more general and shorter solution ...
Hope someone would have an idea. Thank you for your interest.
Julien
Edit:
I get this solution that does what I want, and really graphically:
#!/bin/bash n_item=$(find /* -maxdepth 0 | wc -l) i=0 for file in /* do sleep 1
However, I will continue with fedorqui's solution, which will not take up the entire screen.
Thanks so much for your time.
source share