Pas*_*TIN 16
你可以使用" read":
$ cat ./test.sh
#!/bin/sh
echo -n "enter the value : "
read my_var
echo "The value is : $my_var"
Run Code Online (Sandbox Code Playgroud)
并且,执行脚本:
$ sh ./test.sh
enter the value : 145
The value is : 145
Run Code Online (Sandbox Code Playgroud)