From: laredotornado on
Hi,

I'm using Mac 10.6.3. How can I configure find such that when I run
the comand

find . -name "*.txt"

the "-follow" (follow symlinks) command is automatically included. I
don't want to have to specify this command every time I run find, that
is.

Thanks, - Dave
From: pk on
laredotornado(a)zipmail.com wrote:

> Hi,
>
> I'm using Mac 10.6.3. How can I configure find such that when I run
> the comand
>
> find . -name "*.txt"
>
> the "-follow" (follow symlinks) command is automatically included. I
> don't want to have to specify this command every time I run find, that
> is.

You can use a wrapper function, or use -L if your find supports it and it's
good enough for you.
From: laredotornado on
On May 10, 10:52 am, pk <p...(a)pk.invalid> wrote:
> laredotorn...(a)zipmail.com wrote:
> > Hi,
>
> > I'm using Mac 10.6.3.  How can I configure find such that when I run
> > the comand
>
> > find . -name "*.txt"
>
> > the "-follow" (follow symlinks) command is automatically included.  I
> > don't want to have to specify this command every time I run find, that
> > is.
>
> You can use a wrapper function, or use -L if your find supports it and it's
> good enough for you.

What do you mean a wrapper function? - Dave
From: pk on
laredotornado wrote:

> On May 10, 10:52 am, pk <p...(a)pk.invalid> wrote:
>> laredotorn...(a)zipmail.com wrote:
>> > Hi,
>>
>> > I'm using Mac 10.6.3. How can I configure find such that when I run
>> > the comand
>>
>> > find . -name "*.txt"
>>
>> > the "-follow" (follow symlinks) command is automatically included. I
>> > don't want to have to specify this command every time I run find, that
>> > is.
>>
>> You can use a wrapper function, or use -L if your find supports it and
>> it's good enough for you.
>
> What do you mean a wrapper function? - Dave

Something like this (assuming you call it passing the base path as first
argument):

myfind () {
path=$1
shift
find "$path" -follow "$@"
}

myfind . -name "*.txt"

or, perhaps easier and can be called with less constraints

myfind () {
find -L "$@"
}

myfind . -name "*.txt"