[ALUG] Re: Problem with 'find' and 'basename'

Chris G cl at isbd.net
Fri Jun 8 12:31:40 BST 2007


On Fri, Jun 08, 2007 at 12:24:04PM +0100, Chris G wrote:
> 
> The actual command I want to execute is:-
> 
>     find info -name '*.txt' -exec mv `basename {} .txt`.rst \;
> 
> to change the .txt suffix to .rst.
> 
> Any ideas how to do it?
> 
I think I know the reason for the problem, bash is running the
`basename {} .txt` *before* the find runs as it's part of the command
parsing.  So how do I delay it so that it's run on the output of the
find command?

-- 
Chris Green



More information about the main mailing list