[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bash Shell Parameter Expansion
From: |
tolugboji |
Subject: |
Bash Shell Parameter Expansion |
Date: |
Sat, 09 Oct 2021 14:41:59 +0000 |
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, October 9th, 2021 at 2:36 PM, Greg Wooledge <greg@wooledge.org>
wrote:
> On Sat, Oct 09, 2021 at 09:05:19AM -0500, Dennis Williamson wrote:
>
> > Your assignment is being executed as a command. Why don't you simply do
> >
> > param="Hilbert Transform"
>
> Don't bother asking this person why they do whatever it is that they do.
>
> Just add their current email address-pattern to your ever-growing list
>
> of killfile patterns for blocking them (again).
Instead you should find a donkey and get it in your touche rather than telling
others what to do, dickhead greg.
> (My current email killfile consists of 8 patterns. 6 of them are for
>
> this one person. Seriously, this person is mentally ill and needs to
>
> get help from somewhere other than help-bash.)
>
> > Note the colon. You probably really want to do something else. Here's one
> >
> > example that comes in handy:
> >
> > myfunc () {
> >
> > param=${$1:-"Hilbert Transform"}
> > echo "$param"
> >
> >
> > }
>
> The second $ is incorrect here. You need ${1:-blah blah} instead. Also,
>
> you don't need the inner quotes there, but I guess they don't hurt.
- Bash Shell Parameter Expansion, tolugboji, 2021/10/09
- Re: Bash Shell Parameter Expansion, Reuti, 2021/10/09
- Re: Bash Shell Parameter Expansion, Dennis Williamson, 2021/10/09
- Re: Bash Shell Parameter Expansion, Greg Wooledge, 2021/10/09
- Re: Bash Shell Parameter Expansion, Chet Ramey, 2021/10/09
- Bash Shell Parameter Expansion, tolugboji, 2021/10/09
- Re: Bash Shell Parameter Expansion, Kusalananda Kähäri, 2021/10/09
- Bash Shell Parameter Expansion, tolugboji, 2021/10/09
- Re: Bash Shell Parameter Expansion, Greg Wooledge, 2021/10/09
- Re: Bash Shell Parameter Expansion, Alex fxmbsw7 Ratchev, 2021/10/09
- Bash Shell Parameter Expansion, tolugboji, 2021/10/09
- Re: Bash Shell Parameter Expansion, Alex fxmbsw7 Ratchev, 2021/10/09
- Bash Shell Parameter Expansion, tolugboji, 2021/10/09