(patch for Bash) Python command substitution in Bash

Tim Cargile tecargile at hotmail.com
Sun Feb 16 09:05:13 EST 2003


those who know me have no need of my name <not-a-real-address at usa.net> wrote in message news:<m1smuqfepk.gnus at usa.net>...
> in comp.unix.shell i read:
> 
> >Here is my patch to "command substitution" syntax of Bash to interface
> >with Python automatically.  Not quite "embedding", but close enough for
> >short one-liners.
> >
> >If command string begins with '!', then the rest of string is sent to
> >Python as command-line argument with double quotes, ie.
> >    python -c "string"
> 
> i dislike this appropriation of the special character, especially for so
> trivial an invocation.  at the least the character and the program invoked
> should be configured, rather than hard-coded.

I'm still scratching my head a the notion of 'inline-other-languages'
regardless of the language.  As far as the character goes ... maybe
Bill should have used the #! trick instead.

Tim




More information about the Python-list mailing list