bug-bash
[Top][All Lists]
Advanced

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

Re: [EXT] Re: manual page missing ${parameter-replacement}


From: Lawrence Velázquez
Subject: Re: [EXT] Re: manual page missing ${parameter-replacement}
Date: Mon, 21 Nov 2022 23:06:13 -0500
User-agent: Cyrus-JMAP/3.7.0-alpha0-1115-g8b801eadce-fm-20221102.001-g8b801ead

On Mon, Nov 21, 2022, at 4:38 AM, Ulrich Windl wrote:
> But from the syntax "${parameter:-word}" it's not really obvious that the
> colon may be omitted.

You're not wrong.

> Should it be "${parameter[:]-word}" (with non-bold square brackets) instead
> (as for "name=[value]")?

No, that would be extremely confusing.  But I think something like
this has been suggested before (I don't remember by whom):

    ${parameter-word}
    ${parameter:-word}
            Use Default Values.  [...]
    ${parameter=word}
    ${parameter:=word}
            Assign Default Values.  [...]
    ${parameter?word}
    ${parameter:?word}
            Display Error if Null or Unset.  [...]
    ${parameter+word}
    ${parameter:+word}
            Use Alternate Value.  [...]

> Despite of that only ":-" is typeset in bold; shouldn't "${" and "}" be
> typeset in bold, too?

I don't know.  It seems like boldface is used to highlight the parts
that are unique to each form.

-- 
vq



reply via email to

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