HackerTrans
TopNewTrendsCommentsPastAskShowJobs

squirt

no profile record

comments

squirt
·4 anni fa·discuss
> The whole point of scripts is for them to be dead simple.

To that end, would it not make more sense to always use `[[ ... ]]` for conditions, when I know my .bash scripts will always be invoked by bash?

Consistency is simple.
squirt
·4 anni fa·discuss
Easy.

  declare -A outer=(
    [inner]="_inner"
  )
  declare -A _inner=(
    [key]="value"
  )
Access inner elements via a nameref.

  declare -n inner="${outer[inner]}"
  echo "${inner[key]}"
  # value
Currently writing a compiler in Bash built largely on this premise.