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

13 lines
187 B
Bash

#!/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 $?"