help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] pass command to script


From: David Niklas
Subject: Re: [Help-bash] pass command to script
Date: Wed, 8 May 2019 15:12:05 -0400

On Fri, 26 Apr 2019 09:06:13 -0400
Greg Wooledge <address@hidden> wrote:
> On Fri, Apr 26, 2019 at 07:24:01AM +0000, Warlich, Christof wrote:
> > To me, the almost prefect solution would be if bash offered some sort
> > of nestable quotes right away, e.g. something like $[], which may not
> > already be in use afaik.
>
> $[...] is a deprecated arithmetic expansion syntax.  Try again. ;-)
>
> Another thing you may want to look at is "magic alias".  It's horrible,
> but you seem to be willing to face horrors.

After reading this thread throughly I've been wondering why nobody
proposes the more elegant solution of self created quotes
( I did not invent this, it's a python style idiom. ):

$ echo <zzz This $is # a \ really ' weird ` string. zzz>
This $is # a \ really ' weird ` string.
$ echo <qqq bash -c <qqq echo address@hidden&*()_+{}[]-=/?`"';: qqq> qqq>
address@hidden&*()_+{}[]-=/?`"';:

Simple, elegant, and doomed to be used in real world scripts with horrible
results. Unless some combination of chars becomes reserved, which, given
that zzz or qqq and < > are unlikely, at best, to be combined should be
safe.

Thanks,
David



reply via email to

[Prev in Thread] Current Thread [Next in Thread]