I have a script that I need to run on a large number of files with the extension **.tar.gz*.
Instead of uncompressing them and then running the script, I want to be able to uncompress them as I run the command and then work on the uncompressed folder, all with a single command.
I think a pipe is a good solution for this but i haven’t used it before. How would I do this?
The
-vorderstarto print filenames as it extracts each file:This way the script will contain commands to deal with a single file, passed as a parameter (thanks to
xargs) to your script ($1in the script context).Edit: the
-I {} -d\\npart will make it work with spaces in filenames.