shell/脚本函数/使用return命令.sh

13 lines
187 B
Bash
Raw Normal View History

2016-05-15 09:51:46 +08:00
#!/bin/bash
# using the return command in a function
function db1 {
read -p "Enter a value:" value
echo "doubling the value"
return $[ $value * 2 ]
}
db1
echo "The new value is $?"