📄 ind-func.sh
字号:
#!/bin/bash# ind-func.sh: Passing an indirect reference to a function.echo_var (){echo "$1"}message=HelloHello=Goodbyeecho_var "$message" # Hello# Now, let's pass an indirect reference to the function.echo_var "${!message}" # Goodbyeecho "-------------"# What happens if we change the contents of "hello" variable?Hello="Hello, again!"echo_var "$message" # Helloecho_var "${!message}" # Hello, again!exit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -