perl to python

Andrew Bennetts andrew-pythonlist at puzzling.org
Thu May 13 03:05:28 EDT 2004


On Thu, May 13, 2004 at 06:06:23AM +0000, Andrew Dalke wrote:
[...]
> 
> Trying doing that sanely with any programming language expressed
> all on the command-line.  No credit if you can't handle the '&' and space.

I'm almost positive you can do that entirely with bash[1], actually.  I
don't have time to prove it right now, though... but you ought to be able to
use features like ${paramater%word} expansions, e.g.:

    $ x='something.mbox/mbox'
    $ echo ${x%/mbox}
    something.mbox

Obviously you'd need to be careful about quoting things like & and space,
but that doesn't seem too hard.

-Andrew.

[1] And standard file utilties like mv and rmdir, obviously...




More information about the Python-list mailing list