1. [OT] Recursive dir (linux)
- Posted by ChrisBurch2 <crylex at freeuk.co.uk> Oct 15, 2006
- 595 views
Hi Anyone know of a quick way to recursively copy a directory tree under linux with filemasking. cp -R ~/euphoria/*.e* ~/tmpdir does not work, and only copies the top level. I will write a little routine if there is no solution, just didn't want to re invent the wheel. Chris
2. Re: [OT] Recursive dir (linux)
- Posted by akusaya at gmx.net Oct 15, 2006
- 570 views
> Hi > Anyone know of a quick way to recursively copy a directory tree under linux > with filemasking. > cp -R ~/euphoria/*.e* ~/tmpdir > does not work, and only copies the top level. > I will write a little routine if there is no solution, just didn't want to > re invent the wheel. Maybe you can try this (untested!): cp `find ~/euphoria -iname '*.e*'` ~/tmpdir
3. Re: [OT] Recursive dir (linux)
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Oct 15, 2006
- 563 views
On Sun, 15 Oct 2006 07:47:11 -0700, ChrisBurch2 <guest at RapidEuphoria.com> wrote: >Anyone know of a quick way to recursively copy a directory tree under linux >with filemasking. > >cp -R ~/euphoria/*.e* ~/tmpdir > >does not work, and only copies the top level. what does cp -a give you? Pete
4. Re: [OT] Recursive dir (linux)
- Posted by ChrisBurch2 <crylex at freeuk.co.uk> Oct 15, 2006
- 554 views
Pete Lomax wrote: > > On Sun, 15 Oct 2006 07:47:11 -0700, ChrisBurch2 > <guest at RapidEuphoria.com> wrote: > > >Anyone know of a quick way to recursively copy a directory tree under linux > >with filemasking. > > > >cp -R ~/euphoria/*.e* ~/tmpdir > > > >does not work, and only copies the top level. > what does cp -a give you? > > Pete > > Hi Just the top level. But heres how to do it - find was the key. find ~/euphoria -iname "*.e" -o -iname "*.ex" -o -iname "*.exu" -exec cp --parents '{}' ~/eutemp \; Chris >
5. Re: [OT] Recursive dir (linux)
- Posted by ChrisBurch2 <crylex at freeuk.co.uk> Oct 15, 2006
- 564 views
ChrisBurch2 wrote: > > Pete Lomax wrote: > > > > On Sun, 15 Oct 2006 07:47:11 -0700, ChrisBurch2 > > <guest at RapidEuphoria.com> wrote: > > > > >Anyone know of a quick way to recursively copy a directory tree under linux > > >with filemasking. > > > > > >cp -R ~/euphoria/*.e* ~/tmpdir > > > > > >does not work, and only copies the top level. > > what does cp -a give you? > > > > Pete > > > > > Hi > > Just the top level. But heres how to do it - find was the key. > > find ~/euphoria -iname "*.e" -o -iname "*.ex" -o -iname "*.exu" -exec cp > --parents > '{}' ~/eutemp \; groan - that should have worked, just found its only copying the *.exu s. Oh separate lines in a script it is then. > > Chris > >
6. Re: [OT] Recursive dir (linux)
- Posted by ags <eu at 531pi.co.nz> Oct 16, 2006
- 566 views
ChrisBurch2 wrote: > > ChrisBurch2 wrote: > > > > Pete Lomax wrote: > > > > > > On Sun, 15 Oct 2006 07:47:11 -0700, ChrisBurch2 > > > <guest at RapidEuphoria.com> wrote: > > > > > > >Anyone know of a quick way to recursively copy a directory tree under > > > >linux > > > >with filemasking. > > > > > > > >cp -R ~/euphoria/*.e* ~/tmpdir > > > > > > > >does not work, and only copies the top level. > > > what does cp -a give you? > > > > > > Pete > > > > > > > > Hi > > > > Just the top level. But heres how to do it - find was the key. > > > > find ~/euphoria -iname "*.e" -o -iname "*.ex" -o -iname "*.exu" -exec cp > > --parents > > '{}' ~/eutemp \; > > groan - that should have worked, just found its only copying the *.exu s. Oh > separate lines in a script it is then. Hi Chris I don't have a tailor-made solution for you, but another way to do this is with tar, eg: tar cvf - ~/euphoria/*.e* | tar xf - -C ~/tempdir (Will make a folder 'euphoria' under tempdir) This is how they recommend you do this over separate filesystems too. Gary
7. Re: [OT] Recursive dir (linux)
- Posted by ChrisBurch2 <crylex at freeuk.co.uk> Oct 16, 2006
- 580 views
ags wrote: > > ChrisBurch2 wrote: > > > > ChrisBurch2 wrote: > > > > > > Pete Lomax wrote: > > > > > > > > On Sun, 15 Oct 2006 07:47:11 -0700, ChrisBurch2 > > > > <guest at RapidEuphoria.com> wrote: > > > > > > > > >Anyone know of a quick way to recursively copy a directory tree under > > > > >linux > > > > >with filemasking. > > > > > > > > > >cp -R ~/euphoria/*.e* ~/tmpdir > > > > > > > > > >does not work, and only copies the top level. > > > > what does cp -a give you? > > > > > > > > Pete > > > > > > > > > > > Hi > > > > > > Just the top level. But heres how to do it - find was the key. > > > > > > find ~/euphoria -iname "*.e" -o -iname "*.ex" -o -iname "*.exu" -exec cp > > > --parents > > > '{}' ~/eutemp \; > > > > groan - that should have worked, just found its only copying the *.exu s. Oh > > separate lines in a script it is then. > > Hi Chris > > I don't have a tailor-made solution for you, but another way to do this is > with > tar, eg: > > tar cvf - ~/euphoria/*.e* | tar xf - -C ~/tempdir > > (Will make a folder 'euphoria' under tempdir) Hi Again, strangley, that only did the top level. I think the reasoning goes something like, I have no directories that match *.e*. Th find technique works fine, since even if duplicate files are picked from one line to another, I wanted these anyway. Chris > > This is how they recommend you do this over separate filesystems too. > > Gary
8. Re: [OT] Recursive dir (linux)
- Posted by ags <eu at 531pi.co.nz> Oct 16, 2006
- 576 views
ChrisBurch2 wrote: > > ags wrote: > > tar, eg: > > > > tar cvf - ~/euphoria/*.e* | tar xf - -C ~/tempdir > > > > (Will make a folder 'euphoria' under tempdir) > > Hi > > Again, strangley, that only did the top level. I think the reasoning goes > something like, I have no directories that match *.e*. > > Th find technique works fine, since even if duplicate files are picked from > one line to another, I wanted these anyway. Heh, that's the problem with *nixes I find. You can spend hours reading a man page to figure out how to do one particular task, then forget it when you need it several years later I'm glad find worked, that's another one I spent days reading several man pages for to figure out how to get the 'and execute this' bit working with the proper shell escape sequences for bash. These days I tend to just write scripts to do stuff straight away, I'm over the "these Unix guys knew how to do things properly so they must be right" buzz. :) So, er, yeah, why not just write something in Euphoria to do it?? Gary
9. Re: [OT] Recursive dir (linux)
- Posted by ChrisBurch2 <crylex at freeuk.co.uk> Oct 16, 2006
- 575 views
ags wrote: > > ChrisBurch2 wrote: > > > > ags wrote: > > > tar, eg: > > > > > > tar cvf - ~/euphoria/*.e* | tar xf - -C ~/tempdir > > > > > > (Will make a folder 'euphoria' under tempdir) > > > > Hi > > > > Again, strangley, that only did the top level. I think the reasoning goes > > something like, I have no directories that match *.e*. > > > > Th find technique works fine, since even if duplicate files are picked from > > one line to another, I wanted these anyway. > > Heh, that's the problem with *nixes I find. You can spend hours reading a man > page to figure out > how to do one particular task, then forget it when you need it several years > later > > I'm glad find worked, that's another one I spent days reading several man > pages > for to figure out how to get the 'and execute this' bit working with the > proper > shell escape sequences for bash. > > These days I tend to just write scripts to do stuff straight away, I'm over > the "these Unix guys knew how to do things properly so they must be right" > buzz. > :) > > So, er, yeah, why not just write something in Euphoria to do it?? Hehe - I started, then doing it this or that way intrigued me, and I too got lost in man page heaven! Chris > > Gary