V
V
VN2022-04-15 15:32:53
bash
VN, 2022-04-15 15:32:53

What does this construct mean in bash?

Please tell me what this design means.
programm=${0##*/}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xotkot, 2022-04-15
@kavabangaungava

if done in console

$ echo ${0}
/usr/bin/zsh
$ echo ${0##*/}
zsh

will display the current shell
, if used in a script, it will display the name of the script,
where the zero parameter $0 is the name of the script being run (in this case, the shell), if the path is specified at startup, then it will also be included in the name
according to the command line parameters. For more details, see here
and about $ {STR##*/} see parameter-expansions , if it's short, then specifically here it serves to extract the name (short) from the path

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question