[gllug] echo

Russell Howe rhowe at siksai.co.uk
Wed Apr 20 10:28:43 UTC 2005


On Wed, Apr 20, 2005 at 09:13:36AM +0100, Steve Nelson wrote:
> Richard wrote:
> 
> > The point is that what you type isn't what gets sent to echo.  The
> > shell performs expansion *before* passing the command-line onto the
> > command....
> 
> Ah yes, of course.
> 
> Hence why it must be escaped or quoted.

And also hence why you can't use mv to do what ren could do in DOS:

ren *.foo *.bar

Debian (at least) has a rename command which takes a regex replacement
pattern and a list of filenames to apply the replacement to, which while
maybe not as simple, is certainly more powerful and sane.

Of course, you could always do:

for file in *.foo; do mv "$file" "${file%.foo}.bar"; done

-- 
Russell Howe       | Why be just another cog in the machine,
rhowe at siksai.co.uk | when you can be the spanner in the works?
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list