in reply to Need a script for command line

The canonical answer would be: use tar to create the archive with relative paths and the user directory as top level directory, then extract it in /users/<user>. Nothing special there, as creating relative paths is default.

In Perl, you could use Archive::Tar. Basically, create the archive whichever way you want, using add_files and write (Archive::Tar::write, that is). Then on extraction, use list_files and get_contents to get the various files and write them back wherever you want.

This, however, seems to be a case of hammeritis: 'if you have a big hammer, everything looks like a nail'. Plain command line tar would be the best solution here.

CU
Robartes-

Replies are listed 'Best First'.
Re: Re: Need a script for command line
by Anonymous Monk on Feb 16, 2003 at 19:49 UTC
    Thanks for your reply. I wrote a simple code that using a system command.