relative pathname question!

Deke Kassabian deke at socrates.ee.rochester.edu
Tue Aug 9 01:02:37 AEST 1988


>> [question about backing up files using tar WITHOUT absolute pathnames]
>Set your default directory using "cd" and just use 
>tar cf /dev/whatever *

I would suggest using "." rather than "*" to avoid the expansion of the commmand
line to ridiculously long lengths.  While the meaning is certainly different, I
have yet to think of any problems with this method when the intent is to tar up
the contents of my current directory.

>>As far as I can tell, there is NO way to extract tar files with
>>absolute pathnames anywhere except their original positions.
> sure is, and a damned clever one at that.  its called "sub-system root".
> look up chroot(2) in your unix manual.

Less "clever" and maybe even more sloppy, a few carefully placed symbolic links
often does the trick as well.  Using chroot(2) is probably a bit better.  But
who wants to do either one?

The use of "." helps to avoid this situation, and can be used from anywhere 
(even from '/').


 ------------------------------------------------------------------------
 \\\  Deke Kassabian, URochester Department of Electrical Engineering  \\\
  \\\ deke at ee.rochester.edu                  "I never metacharacter     \\\
   \\\   or ...!rochester!ur-valhalla!deke     I didn't like......"      \\\
    -------------------------------------------------------------------------
          Quick as a wink, the sly cat stole Monroe's cheese sandwich



More information about the Comp.unix.wizards mailing list