Dave's Brain

Browse - programming tips - removing leading slash from member names

Date: 2008nov6
Language: bash

Q.  When I use tar it says:
"Removing leading `/' from member names"
how can I suppress that message?

A.  I wish there was an option for this but here is the best way.

If you are doing:

	tar cf /aaa/bbb/ccc.tar /xxx/yyy/zzz

Change it to:

	SRC=/xxx/yyy/zzz
	DIRNAME=`dirname $SRC`
	BASENAME=`basename $SRC`
	tar cf /aaa/bbb/ccc.tar -C $DIRNAME $BASENAME

What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2012, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.
Advertisements: