mirror of https://github.com/fengyuhetao/shell.git
13 lines
167 B
Bash
13 lines
167 B
Bash
|
#!/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"
|
||
|
|