How to echo a variable containing an unescaped dollar sign in bash

后端 未结 4 1701
攒了一身酷
攒了一身酷 2020-12-01 21:16

If I have a variable containing an unescaped dollar sign, is there any way I can echo the entire contents of the variable?

For example something calls a script:

4条回答
  •  天命终不由人
    2020-12-01 21:32

    by using single quotes , meta characters like $ will retain its literal value. If double quotes are used, variable names will get interpolated.

提交回复
热议问题