bug-bash
[Top][All Lists]
Advanced

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

Re: Typo in Bash Reference Manual


From: Stan Marsh
Subject: Re: Typo in Bash Reference Manual
Date: Sun, 29 Jun 2025 06:39:18 -0600

>"Note that a negative offset must be separated from the [non-following]
>colon by at least one space to avoid being confused with the ':-'
>expansion,' since a negative offset can exist immediately beside a
>subsequent colon.

>Wiley

Note, incidentally, that it is not strictly true that a negative offset has
to be preceded by a space.  A zero will work as well.  And I think that is
clearer.  I.e., instead of:

# Print the last 2 characters of $HOME
$ echo ${HOME: -2}

You can do:

$ echo ${HOME:0-2}

Or even:

$ echo ${HOME:7-9}

=================================================================================
Please do not send me replies to my posts on the list.
I always read the replies via the web archive, so CC'ing to me is unnecessary.

Note that they always end up in my Spam file anyway, so it is annoying to have 
to
periodically clean that out.



reply via email to

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