The thing is, you can give parallel filenames that don't exist, and it's still useful to be able to operate on them, which dirname can do but find -execdir cannot. Re-implementing find seems like a lot of undesirable complexity. I agree that it might be convenient to have a shorthand for dirname; I use parallel as a multi-rename swiss army knife all the time. :)
As for the corner cases, the least-surprising and probably easiest thing to do is emulate dirname(1), which (I'm told) is exactly what Perl's File::Basename does. On Mon, Apr 25, 2011 at 11:50 AM, Cook, Malcolm <[email protected]> wrote: > Thanks, Jay, sure, that works fine and is what I'm doing now. > > Similarly, $(basename {}) work instead of {.} > > It is just a convenience factor that is easily coded around. > > I think my request to have parallel exec the code in the directory containing > the file is perhaps more relevant.... what do you think? > > Malcolm Cook > Stowers Institute for Medical Research - Bioinformatics > Kansas City, Missouri USA > > > >> -----Original Message----- >> From: [email protected] >> [mailto:[email protected]] On Behalf >> Of Jay Hacker >> Sent: Monday, April 25, 2011 10:39 AM >> To: [email protected] >> Subject: Re: {.} {/} {/.} ... >> >> How about $(dirname {})? As in: >> >> find . | parallel 'echo $(dirname {})' >> >> >> On Fri, Apr 22, 2011 at 3:12 PM, Cook, Malcolm >> <[email protected]> wrote: >> > how about some syntax to get the dirname of {} >> > >> > maybe {..} >> > >> > ~malcolm >> > >> >>
