全局变量

4年以前  |  阅读数:403 次  |  编程语言:Shell 
#!/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"

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8