[PLUG] Copying From Multiple Source Directories to a Destination Directory

Russell Johnson russj at dimstar.net
Mon Jun 14 02:56:30 UTC 2010


On 6/13/2010 5:34 PM, Rich Shepard wrote:
>     I'm upgrading PSTricks. There are 50 modules, and the relevant .tex files
> are each in its own directory. I thought that I could cd to the parent
> directory of these and use 'cp -R *.tex
> /usr/share/texmf/tex/generic/pstricks' but the shell tells me it cannot find
> a *.tex file.
>
>     Do I need to use a for loop so the shell knows to look in each directory
> for the .tex file to copy? Or have I not used the cp command correctly?
>    

Are you wanting to copy just the .tex files, and into the same directory 
structure?

This should do that:

|tar cf - *.tex | ( cd /target; tar xfp -)|

Not tested. I've used similar for backing up to disk.

-- 
Russell Johnson
russj at dimstar.net
Dimension 7 Consulting.
http://www.dimstar.net
Windows, Linux, Solaris, AIX, HP-UX, OS/X




More information about the PLUG mailing list