I am completely new to the bash world, and now I am working on a script that will cycle through a large directory and retrieve any .tar files that it finds at this current location.
I am using the following script:
for a in in /home/davidwright/attachments/*/*.tar do echo "extracting $x" tar -xvf $x done
Currently the file is being extracted fine, but it is being extracted to the location of my script. I need to extract it from the current .tar directory.
The solution is probably very simple, but I cannot figure it out for me. Thanks!
source share