linux-tutorial/codes/shell/脚本函数/使用函数输出.sh
2019-10-29 18:22:19 +08:00

13 lines
175 B
Bash

#!/usr/bin/env bash
# using the echo to return a value
function db1 {
read -p "Enter a value:" value
echo $[ $value * 2 ]
}
result=`db1`
echo "The new value is $result"