Re: Wanted: quoted param expansion that expands to nothing if no params

2021-03-24 Thread Dale R. Worley
L A Walsh writes: > It would be nice to have a expansion that preserves arg boundaries > but that expands to nothing when there are 0 parameters > (because whatever gets called still sees "" as a parameter) Fiddling a bit, I found this is a nice way to show how "$@" (or any other construction)

Re: Wanted: quoted param expansion that expands to nothing if no params

2021-03-24 Thread Eli Schwartz
On 3/24/21 3:49 PM, Ilkka Virta wrote: > On Wed, Mar 24, 2021 at 9:38 PM L A Walsh wrote: > >> Hmmm...Now that I try to show an example, I'm not getting >> the same results. Grrr. Darn Heizenbugs. >> > > Just remember that if you test with printf, it always prints at least once, > which

Re: Wanted: quoted param expansion that expands to nothing if no params

2021-03-24 Thread Ilkka Virta
On Wed, Mar 24, 2021 at 9:38 PM L A Walsh wrote: > Hmmm...Now that I try to show an example, I'm not getting > the same results. Grrr. Darn Heizenbugs. > Just remember that if you test with printf, it always prints at least once, which makes it look exactly as if it got an empty string

Re: Wanted: quoted param expansion that expands to nothing if no params

2021-03-24 Thread L A Walsh
On 2021/03/23 21:41, Lawrence Velázquez wrote: On Mar 23, 2021, at 11:43 PM, Eli Schwartz wrote: It's not clear to me, how you expect this to differ from the existing behavior of "$@" or "${arr[@]}" which already expands to rather than an actual "" parameter. The original message

Re: Wanted: quoted param expansion that expands to nothing if no params

2021-03-23 Thread Lawrence Velázquez
> On Mar 23, 2021, at 11:43 PM, Eli Schwartz wrote: > > On 3/23/21 11:24 PM, L A Walsh wrote: >> Too often I end up having to write something like >> if (($#)); then "$@" >> else # = function or executable call >> fi >> >> It would be nice to have a expansion that preserves arg

Re: Wanted: quoted param expansion that expands to nothing if no params

2021-03-23 Thread Eli Schwartz
On 3/23/21 11:24 PM, L A Walsh wrote: > Too often I end up having to write something like > if (($#)); then "$@" > else   # = function or executable call > fi > > It would be nice to have a expansion that preserves arg boundaries > but that expands to nothing when there are 0 parameters >

Wanted: quoted param expansion that expands to nothing if no params

2021-03-23 Thread L A Walsh
Too often I end up having to write something like if (($#)); then "$@" else # = function or executable call fi It would be nice to have a expansion that preserves arg boundaries but that expands to nothing when there are 0 parameters (because whatever gets called still sees "" as a