获取终端输入内容(方法1)
#!/bin/bash
echo "enter: "
read words
echo "result: $words"
获取终端输入内容(方法2)
#!/bin/bash
read -p "please enter your age: " age
days=$[ $age *365 ]
echo age is $days
获取终端输入内容(方法3)
#!/bin/bash
read -p "enter name & age": " first second
echo name: $first, age: $second
获取终端输入内容(方法4)
#!/bin/bash
read -p "enter a number:"
factorial=1
for((i=1; i<$REPLY; i++))
do
factorial=$[$factorial * $i]
done