[Lazarus] target filename extension

Damien Gerard milipili at shikami.org
Thu May 22 10:14:09 CEST 2008


Le May 22, 2008 à 10:01 AM, Graeme Geldenhuys a écrit :

> Micha Nelissen wrote:
>>>
>>> find UnitTests -name '' -type f -perm /111 -regex '[^.]+' -exec rm  
>>> {} \;
>>
>> Escape the '{}':
>>
>> ... rm \{\} \;
>>
>> Remove the -name; don't know what that should do.
>>
>> Perhaps wise to use 'echo' first, to see what you're going to  
>> delete ;-).
>
> Good idea! :-)
>
> Escaping didn't work. I had to remove the -regex command, then things
> started to go my way.
>
> eg:
>   find UnitTests -type f -perm /111 -exec echo {} \;
>

if UnitTests is the name of your files you may use -iname :

find -iname 'Unittests' -type f -perm /111 -exec echo '{}' \;


>
> It now listed all executable files...  :-)
> Reading through the 'find' man page, it's damn impressive what the  
> find
> command can do. A real hidden treasure.

find as many others command-line unix program are real treasures :)



--
Damien Gerard
milipili at shikami.org

"Intelligence is 10 million rules."
    -- Douglas Lenat









More information about the Lazarus mailing list