Ok I see, so the only way for this to work would be to create a shell script 
that uses the function, I suppose?

Yes it does work, but I was more interested in the how, in general, not 
specifically this example.

Thanks for your time!

On Jul 24, 2012, at 3:37 PM, "Maxim Gonchar" <gma...@gmail.com> wrote:

> then you definitely can not use xargs, since it can run only executables.
> But the method I proposed should work.
> 
> Maxim
> 
> On Tue, 24 Jul 2012 21:44:08 +0900, Eloy Durán <eloy.de.en...@gmail.com> 
> wrote:
> 
>> Sorry for not being clear enough, in this example `clean_file` is my 
>> function.
>> 
>> On Jul 24, 2012, at 2:42 PM, "Maxim Gonchar" <gma...@gmail.com> wrote:
>> 
>>> Hi,
>>> 
>>> the clean_file executable is not found.
>>> What is clean_file? Does `which clean_file` prints something?
>>> As for the syntax, I guess you can use the following instead:
>>> 
>>> clean_file (find Classes -name '*.m' -print0)
>>> 
>>> regards,
>>> Maxim
>>> 
>>> On Tue, 24 Jul 2012 21:38:35 +0900, Eloy Durán <eloy.de.en...@gmail.com> 
>>> wrote:
>>> 
>>>> Hi,
>>>> 
>>>> I have a function that operates on one file. Now I have a list of files, 
>>>> for instance from `find`, which I would all like to pass to this function 
>>>> one by one. In my naive attempt I did the following:
>>>> 
>>>> find Classes -name '*.m' -print0 | xargs -0 clean_file
>>>> 
>>>> For which I get the error: “clean_file: No such file or directory”. (Same 
>>>> goes for using `find -exec`.)
>>>> 
>>>> I’m sure I’m using incorrect syntax, I’ve also tried adding parentheses 
>>>> around the function name, but I’m just trying things by now. Can someone 
>>>> show the way?
>>>> 
>>>> Cheers,
>>>> Eloy
>>>> ------------------------------------------------------------------------------
>>>> Live Security Virtual Conference
>>>> Exclusive live event will cover all the ways today's security and
>>>> threat landscape has changed and how IT managers can respond. Discussions
>>>> will include endpoint security, mobile security and the latest in malware
>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>>> _______________________________________________
>>>> Fish-users mailing list
>>>> Fish-users@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/fish-users
>> 
>> 
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Fish-users mailing list
>> Fish-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/fish-users


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to