Hi,
i'm pretty new to unix and shell scripting and i need to untar a load of files all with different names e.g. YAAN00.V404.T13467.tar, YAAN00.V404.T15623.tar etc with the .T* part following no particular series.
I tried to untar them in a script using simply
find . -name "YAAN00.V404.T*.tar" -exec tar xf {} \;
How does it work?
The find command looks in current dir (.) for files matching the -name clause then for each file it executes the tar xf command substituting the file name for {} the \; marks the end of the command to be exec'd (I think).
NB. This command will recurse into sub-directories aswell.
PS. The tar command does not allow you to untar multiple files as it assumes the first argument after f is the tar file and any further arguments are files you would like to extract from the tar file. This allows you to pick individual files from a tar file if you wish.