0

What does this mean in bash scripting:

local cluster=${1:-none}

looks like assignment of first argument, but what is other code for?

Dims
  • 47,675
  • 117
  • 331
  • 600
  • 2
    [shell parameter expansion](https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html#Shell-Parameter-Expansion) `${parameter:-word}` If parameter is unset or null, the expansion of word is substituted. Otherwise, the value of parameter is substituted. Note: it's not bash specific but for all [POSIX shell](https://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_02) – Nahuel Fouilleul Jul 31 '19 at 10:10
  • https://stackoverflow.com/questions/38909081/shell-what-is-the-purpose-of-var-when-var-is-unset-or-null – William Pursell Jul 31 '19 at 11:33
  • https://stackoverflow.com/questions/15806949/usage-of-and-in-shell-script-while-exporting-variable/15807096#15807096 – William Pursell Jul 31 '19 at 11:35
  • https://stackoverflow.com/questions/41893336/replace-empty-element-in-bash-array/41893887#41893887 – William Pursell Jul 31 '19 at 11:35

0 Answers0