|
| From: | D630 |
| Subject: | Use readonly wherever possible? |
| Date: | Wed, 06 May 2020 10:44:08 +0200 |
| User-agent: | Posteo Webmail |
foo() {
local -r bar=$1
local -r lich=$2
echo "$((bar * lich))"
}
I think that's unusual code in the shell-code universum. My first reflex
was to say "No, don't do that", but I hesitate with my answer, because I
have no idea what happens exactly in bash when a variable is declared
readonly. So is there any advantage in using readonly wherever possible?
| [Prev in Thread] | Current Thread | [Next in Thread] |