使用函数输出

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

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8