How to script automate unTAR of packages

Bruce Dubbs bruce.dubbs at gmail.com
Mon Dec 28 17:47:43 PST 2009


Andres P wrote:
> On Mon, Dec 28, 2009 at 2:19 PM, Mikie <kmb at mikienet.com> wrote:
>> What am I doing wrong?
> 
> You are probably using GNU tar, so tar xvf works for all tarballs. And
> you also don't need to do such a long script:
> 
> #!/bin/sh
> for file in /mnt/lfs/sources/*.tar*; do
>   tar xvf $file
> done

There are three types of options, bsd, short, and long.  The bsd options 
are those without the hyphen to start an are deprecated, although they 
still work.

bsd style options are position dependent and less flexible.

Try:

    tar -f subversion-1.6.4.tar.bz2 -xv

you can't do that with bsd options.

   -- Bruce





More information about the lfs-support mailing list