Sujet : Re: How many ways can you run a script?
De : nunojsilva (at) *nospam* invalid.invalid (Nuno Silva)
Groupes : comp.os.linux.miscDate : 02. Jun 2024, 12:48:19
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v3hilj$3ajff$1@dont-email.me>
References : 1 2 3
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
On 2024-06-02, Woozy Song wrote:
Fritz Wuehler wrote:
Woozy Song <suzyw...@outlook.com> [WS]:
WS> I know these are not all equivalent and may have idiosyncracies.
>
Idiosyncracies is shell's middle name.
Use them or lose them, as they say...
>
$ ${0/-} myscript
>
(assuming that this is a login tty and your shell is bash)
>
>
That is an obscure one! What does the /- mean?
I'm guessing it's "delete all matches of '-' in $0"?
See «'${PARAMETER/PATTERN/STRING}'» in
info '(bash)Shell Parameter Expansion'
-- Nuno Silva