[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: utmac -muh error on Ubuntu
From: |
Tadziu Hoffmann |
Subject: |
Re: utmac -muh error on Ubuntu |
Date: |
Mon, 5 Jul 2021 16:07:12 +0200 |
User-agent: |
Mutt/1.11.4 (2019-03-13) |
> > echo ".ds head-str ${str: -1}"
> The compatible syntax is ${str:-1}.
I wonder if that is meant, though.
Bash also has
${parameter:offset}
${parameter:offset:length}
Substring Expansion. Expands to up to length characters of
the value of parameter starting at the character specified
by offset.
with the caveat that
Note that a negative offset must be separated from the
colon by at least one space to avoid being confused with
the :- expansion.
This latter is something that all Bourne-compatible shells
understand, here in a summary by POSIX:
| parameter set | parameter set | parameter unset
| and not null | but null |
-------------------+----------------------+-----------------+----------------
${parameter:-word} | substitute parameter | substitute word | substitute word
${parameter-word} | substitute parameter | substitute null | substitute word
${parameter:=word} | substitute parameter | assign word | assign word
${parameter=word} | substitute parameter | substitute null | assign word
${parameter:?word} | substitute parameter | error, exit | error, exit
${parameter?word} | substitute parameter | substitute null | error, exit
${parameter:+word} | substitute word | substitute null | substitute null
${parameter+word} | substitute word | substitute word | substitute null
but the purpose of this differs from that of the bashism above.
- utmac -muh error on Ubuntu, Valtteri Vuorikoski, 2021/07/04
- Re: utmac -muh error on Ubuntu, John Ankarström, 2021/07/04
- Re: utmac -muh error on Ubuntu,
Tadziu Hoffmann <=
- Re: utmac -muh error on Ubuntu, John Ankarström, 2021/07/06
- Re: utmac -muh error on Ubuntu, John Ankarström, 2021/07/06
- Re: utmac -muh error on Ubuntu, Valtteri Vuorikoski, 2021/07/07
- Re: utmac -muh error on Ubuntu, John Ankarström, 2021/07/07
- Re: utmac -muh error on Ubuntu, address@hidden, 2021/07/09