On 28/11/2007, Alex Samad <[EMAIL PROTECTED]> wrote:
> Hi
>
>
> I have this commend which i use
>
> find  -mindepth 2 -type d -exec bash -c 'ls -l "{}" | tail -n 2' \;
>
> I have tried to format the -exec option with out the bash -c, but I can't
> figure out a way to escape off the |

If you don't want bash to interpret the 'ls -l "{}" | tail -n 2' then
which program is supposed to interpret the pipeline symbol?

>
> I could make a function out if it, but was wondering if there were any find
> experts who could shed light on it ?

Such questions are served much better 99% of the time when the intent
of this whole exercise is given.

It appears as if you are trying to get the ls output for the last two
files in each directory (sorted by name). Is this correct? What kind
of data do you want about them (i.e. do you need exactly an "ls -l"
format output)? What do you want to do with that information?

--Amos
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to