哪个 Bash 命令可以将标准输入中的一行内容读入名为 temp 的变量?
temp
它始终使用 $1 作为命令行参数。
$1
温度被硬编码为 15。
echo 会读取温度并自动为其赋值。
echo
read temp 将用户输入的一行内容赋值给变量 temp。
read temp