(patch for Bash) adding Python features to Bash

William Park opengeometry at yahoo.ca
Thu Feb 13 21:48:22 EST 2003


Skip Montanaro <skip at pobox.com> wrote:
> 
>    William> To Python and Bash users:
> 
>    William> I got tired of going back and forth between Python and Bash.
>    William> So, I added few Python features to the shell....
> 
>    William> 1.  Integer sequence generator:
>    ...
> 
> I've had this in my personal bin directory for about three years:

...

>    print string.join(map(str, range(low, high, step)))

Actually, this already exist in the form of 'seq' on most Linux.
However, my patch to Bash is integer generator within the context of
"brace expansion".  So, 
    echo p{1..3}s
is equivalent to
    echo p{1,2,3}s
which is equivalent to
    echo p1s p2s p3s

-- 
William Park, Open Geometry Consulting, <opengeometry at yahoo.ca>
Linux solution for data management and processing. 




More information about the Python-list mailing list