[wplug] TAR Shell Question
Wise, Jeremey
WISEJ at PIOS.com
Fri Mar 7 13:45:14 EST 2003
I have been doing some testing on a box. (Hardware / Kernel interaction
issues) The test we are doing is an NFS copy to crush Network / Memory (this
generates the hard crash). Either way.....the real issue is that we were
trying to get the test to mount two separate NFS exports on a server and tar
the files from share1 ->local-> share2.
Here is the script that work:
#!/bin/bash
mount -t nfs 10.0.0.100:/home/test /mnt/cdrom
mount -t nfs 10.0.0.100:/home/test1 /mnt/floppy
tar cf - -C /mnt/floppy . |tar -xvf - -C /mnt/cdrom
Though this works I do not understand why this does not.
tar -cf -C - /mnt/floppy . |tar -xvf -C - /mnt/cdrom
This should be the better / working syntax as bash interperatest the "-" as
"-" which (if you RTFMP) you read that
" -- A -- signals the end of options and disables
further option processing. Any arguments after
the -- are treated as filenames and arguments.
An argument of - is equivalent to --."
and so implies that the working script should NOT work as the "-C" to
specify the directory for parsing the tar would not be passed to tar.
Can someone explain me what I am misunderstanding here!?!?!??!
Thx.
Jeremey Wise (440)-519-6006
(CNE,MCSE,CSE)
Pioneer-Standard Electronics, Inc
wisej at pios.com
More information about the wplug
mailing list