.sh & tar

illoai at gmail.com illoai at gmail.com
Thu Jun 3 14:03:06 UTC 2010


On 3 June 2010 07:42, Polytropon <freebsd at edvax.de> wrote:
> On Thu, 03 Jun 2010 09:32:17 +0800, Aiza <aiza21 at comclark.com> wrote:
>> When I exec tar from within a .sh shell script I get this message
>> tar: Removing leading '/' from member names
>> I have tar outputting to > /dev/null and still get this message.
>> With -v or without makes no difference.
>>
>> How can I stop this
>
> Depends on WHAT you want to stop - the illness or just its symptoms. :-)
>
> If it's just about symptoms, redirect the error messages into
> nirvana.
>
>        tar [opts] [file] 1>/dev/null 2>&1
>
> If you want to remove the REASON for "tar: Removing leading '/'
> from member names", you need to re-create the archives and
> start archiving from a relative point (instead of from an
> absolute one), e. g.
>
>        # cd /
>        # tar cvf etc.tar etc/
>
> (lazy man's method) instead of
>
>        # tar cvf etc.tar /etc/
>
> The extraction of the archive will usually start in the
> current directory, so
>
>        # cd /usr/local/bin
>        # tar xvf etc.tar
>
> won't give you an etc/ subtree in /usr/local/bin directory.
>

tar -cvf - ./ -C / > /dev/null
?

-- 
--


More information about the freebsd-questions mailing list