0

I have this snippet of bash:

enter image description here

I'd understand the snippet if the exclamation mark didn't exist, as it's a simple check of whether varname is empty.

What the heck is !varname?

Community
  • 1
  • 1
Eric Zhang
  • 57
  • 1
  • 5
  • In short, "${!varname}" is the value of the variable whose _name_ is `$varname`. – John1024 May 23 '19 at 19:16
  • 5
    For future reference, [never post images of text](http://meta.unix.stackexchange.com/questions/4086/psa-please-dont-post-images-of-text?cb=1). – John1024 May 23 '19 at 19:17
  • 1
    Also, the `sh` tag should be used only for questions about POSIX sh. This question asks about a bash-only feature, one that isn't present in sh. – Charles Duffy May 23 '19 at 19:28

0 Answers0