27
[Weekly thread] GNU+Linux help: ask anything!
(programming.dev)
A community for everything relating to the GNU/Linux operating system (except the memes!)
Also, check out:
Original icon base courtesy of lewing@isc.tamu.edu and The GIMP
You're probably over-complicating things. Have you heard about the
find -print0 | xargs -0idiom? all that variable interpolation (dir=${dir:2}) and quoting"'""${dir}""'"is better to be dealt by the built-in shell tools. Or you could write a script for the whole body of that while loop, and then callfind . -exec ./action.sh {} \;. Same script could be used with the previously mentioned idiom too, you'd need to usebash -c ./action.shthough. One advantage of "find | xargs" is that you can run these concurrently, paralellizing the action to all your dirs, in groups, of say 4 of them... and so on... it's cool and simple.