Christopher Sawtell wrote:
> On Monday 02 April 2007, Roger Searle wrote:
>
>> tar -xvf $TarData
>>
>> How can I modify my "tar -xvf" line when I do not know the full
>> names of my backup files - but do know the first few characters?
>>
>
> Assuming you have the Bash Shell, how about something like:-
>
> for tf in `ls backup-*Sun*.tgz` ; do tar xvzf $tf ; done ;
>
Great, that does it.
> use tvzf for the tar options to do a dry run to make sure you have the
> correct
> stuff.
> That will extract all the data in the tar-file for Sunday.
>
> remember the -C option to put the data in the required destination directory.
>
OK, that will save me a line, I'll do that too.
> The manual page is actually pretty fine.
>
> You'd find both the Bash Reference Manual:-
> http://rholbert.colug.net/pdf/bashref.pdf
> and the Advanced Bash Scripting guide:-
> http://tldp.org/LDP/abs/html/
> pretty useful.
>
They are great resources, thanks for them. Just what I need!
Roger
> --
> CS
>
>