How to enter escape character in a positional string argumentfrom the command line?

Chris Angelico rosuav at gmail.com
Wed Dec 21 12:00:44 EST 2022


On Thu, 22 Dec 2022 at 03:58, gene heskett <gheskett at shentel.net> wrote:
>
> On 12/21/22 11:22, Chris Angelico wrote:
> > On Thu, 22 Dec 2022 at 03:11, Stefan Ram <ram at zedat.fu-berlin.de> wrote:
> >>
> >> Lars Liedtke <lal at solute.de> writes:
> >>> Or you could have "native" bash ($SHELL) with WSL.
> >>
> >>    In this newsgroup, it would actually be obvious to use Python.
> >
> > Less obvious than you might think - partly because bash is just so
> > dang good that it's really really hard to outdo it :) Sure, bash has a
> > lot of weird and wonky edge cases, but it's an incredibly practical
> > shell to use.
> >
> When you make a statement like that, Chris, you should also note that
> every single one of those "wonky edge cases" is documented down to the
> last dotted i. Bash's docs will kill a good sized pulp tree, needing
> around a ream of paper to print on a duplex printer. I know, I did it
> around a decade ago. If you like to write scripts, having a dead tree
> copy of the docs at your elbow in incredibly useful.  That huge man page
> does not cover it like the printed docs do.
>

Oh yes, absolutely true. Its wonkiness is dependable and consistent;
but it is definitely quirky (look at all the different ways to embed
arguments into things, and the ways that $*, $@, "$*, and "$@" behave
when put into variables). Not usually a problem, but it does sometimes
leave you thinking "wow, wouldn't it be easier to just use something
like Python?". And in the complicated cases, yeah, it can be. But in
the simple cases? Bash rocks.

ChrisA


More information about the Python-list mailing list