shell/脚本函数/使用函数输出.sh

12 lines
164 B
Bash
Raw Normal View History

2016-05-15 09:51:46 +08:00
#!/bin/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"