On Wed, Mar 22, 2000 at 08:19:29PM +0300, Gaal Yahas wrote:
> On Wed, Mar 22, 2000 at 10:03:29AM +0200, Adi Stav wrote:
> > > You can use cp -a on each mounted filesystem (I used to advocate
> > > tar|tar, but on new linux systems cp is even better[1]), and manually
> > > make the swap partition.
> >
> > Really? Is it because of the new Linux kernel or because of some
> > fileutils enhancements? (I like tar|tar... Feels so Unixly elegant)
> 
> Well, as someone demonstrated here (I am sorry, I don't remember who;
> perhaps it was plp?) in one of the non-recent How-To-Back-Up-A-
> -Filesystem threads, cp -a handles special files more gracefully than
> tar|tar. I agree with the feeling of grace tar|tar gives, especially
> when using subshells, thus:
> 
>       tar cf - . | (cd /target ; tar xvf -)

You can also use the -C flag to specify the directory (I don't know if
it's GNU-specific) to make it easier:

tar cf - -C sourcedir | tar xvf - -C targetdir

> But there you have it. And yes, the improvement is in GNU fileutils
> (I think).
> 
> Of course, one should never let one's tar|tar habits rust, as it is
> still useful on systems without new GNU cp's (as mentioned), and also
> on our favorite OS when copying to netcat or similar.
> 
> Hmmm, anyone care to patch GNU cp to accpet - as either source or
> destination? This is not a trivial change, of course, as it should
> work more like a directory than like a file.

Just use proc.

cp file /proc/self/fd/0 

is equivalent to cat.

You can also use /proc/self/fd/2 if you want the file to go to error
and so on. Unless I did not understand exactly what you meant.

 
> -- 
> believing is seeing
> [EMAIL PROTECTED]
> http://www.forum2.org/gaal/

        - Adi Stav

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to