copy the content from corrosponding paths from two files

copy the content from corrosponding paths from two files

am 15.04.2008 22:18:25 von bhaveshah

Hi Gurus,
I've two files each with srcpath and destpath. I need to copy files
from each srcpath to its corrosponding destpath.

srcfile

/ms1/test1/test2
/ms2/test4/test5

destfile
/ds1/tst1/tst5
/ds3/tst4/tst6
---

So i need to copy dir from
scp /ms1/test1/test2 /ds1/tst1/tst5
scp /ms2/test4/test5 /ds3/tst4/tst6

Please help.

Re: copy the content from corrosponding paths from two files

am 15.04.2008 23:01:41 von Michael Tosch

explor wrote:
> Hi Gurus,
> I've two files each with srcpath and destpath. I need to copy files
> from each srcpath to its corrosponding destpath.
>
> srcfile
>
> /ms1/test1/test2
> /ms2/test4/test5
>
> destfile
> /ds1/tst1/tst5
> /ds3/tst4/tst6
> ---
>
> So i need to copy dir from
> scp /ms1/test1/test2 /ds1/tst1/tst5
> scp /ms2/test4/test5 /ds3/tst4/tst6
>
> Please help.


paste srcfile destfile | sed 's/^/cp /' | sh

--
Michael Tosch @ hp : com

Re: copy the content from corrosponding paths from two files

am 15.04.2008 23:43:49 von Chris Mattern

On 2008-04-15, explor wrote:
> Hi Gurus,
> I've two files each with srcpath and destpath. I need to copy files
> from each srcpath to its corrosponding destpath.
>
> srcfile
>
> /ms1/test1/test2
> /ms2/test4/test5
>
> destfile
> /ds1/tst1/tst5
> /ds3/tst4/tst6
> ---
>
> So i need to copy dir from
> scp /ms1/test1/test2 /ds1/tst1/tst5
> scp /ms2/test4/test5 /ds3/tst4/tst6
>
> Please help.

paste srcfile destfile | xargs -n 2 scp

Or,

paste srcfile destfile | sed 's/^/scp /' | sh

The second might be better; it's less likely to
overwrite files if your input files aren't squared
away.

--
Christopher Mattern

NOTICE
Thank you for noticing this new notice
Your noticing it has been noted
And will be reported to the authorities

Re: copy the content from corrosponding paths from two files

am 16.04.2008 18:57:58 von bhaveshah

On Apr 15, 2:43=A0pm, Chris Mattern wrote:
> On 2008-04-15, explor wrote:
>
>
>
>
>
> > Hi Gurus,
> > I've two files each with srcpath and destpath. I need to copy files
> > from each srcpath to its corrosponding destpath.
>
> > srcfile
>
> > /ms1/test1/test2
> > /ms2/test4/test5
>
> > destfile
> > /ds1/tst1/tst5
> > /ds3/tst4/tst6
> > ---
>
> > So i need to copy dir from
> > scp /ms1/test1/test2 /ds1/tst1/tst5
> > scp /ms2/test4/test5 /ds3/tst4/tst6
>
> > Please help.
>
> paste srcfile destfile | xargs -n 2 scp
>
> Or,
>
> paste srcfile destfile | sed 's/^/scp /' | sh
>
> The second might be better; it's less likely to
> overwrite files if your input files aren't squared
> away.
>
> --
> =A0 =A0 =A0 =A0 =A0 =A0 =A0Christopher Mattern
>
> NOTICE
> Thank you for noticing this new notice
> Your noticing it has been noted
> And will be reported to the authorities- Hide quoted text -
>
> - Show quoted text -

Thanks Chris. It worked!!!!!!!