linux-tutorial/codes/shell/示例脚本/脚本函数/全局变量.sh

13 lines
167 B
Bash
Raw Normal View History

2019-05-10 11:17:57 +08:00
#!/bin/bash
# using a global variable to pass a value
function db1 {
value=$[ $value * 2 ]
}
read -p "Enter a value: " value
db1
echo "The new value is : $value"