$ read -p "Enter input: " MYVAR sh: read: -p: no coprocess Oh, of course, “no coprocess”! Surely, if I can somehow just add a “coprocess” then my read command will work… </sarcasm> Anyway, I dug through info sh to see how the read command works on my OpenBSD system....
# 写法一:read -p 选项类似echo的作用 read -p "请输入您的名字:" in_name echo "您输入的名称为:$in_name" # 写法二:会存在换行输入 echo "请输入你的年龄:" read in_age echo "您输入的年龄是:$in_age" 1. 2. 3. 4. 5. 6. 7. 8. 运行结果 实例6:当前时间为变量,创建文件 AI检测代码...
实例5:用户输入表示in_name变量的值需要用户通过键盘输入得到 #写法一:read -p 选项类似echo的作用read -p"请输入您的名字:"in_name echo"您输入的名称为:$in_name"#写法二:会存在换行输入echo"请输入你的年龄:"read in_age echo"您输入的年龄是:$in_age" 运行结果 实例6:当前时间为变量,创建文件 now_...
1.read -p 获取输入内容 -p prompt:指定提示符,用于提示用户输入数据。 2.read -a 获取输入数组 -a array:将输入数据存储到一个数组中。 七、预定义变量小实验 1.判断两个数是否相等 1代表错误
read -p "检测到旧配置!!!输入数字继续(【备份旧配置到/root/nps_back/conf】请输入1,【放弃旧配置】请输入2(默认1):" up_vvv [ -z "$up_vvv" ] && up_vvv='1' if [[ $up_vvv != '2' ]];then TIME=$(date "+%Y-%m-%d_%H-%M-%S") echo '备份旧配置到/root/nps_back/conf...
--with-stream_ssl_preread_module \ --with-threads \ --with-http_secure_link_module \ --with-http_gunzip_module" # "Combining -flto with -g is currently experimental and expected to produce unexpected results." # https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html CC_OPT=...
README GPL-3.0 license An ACME Shell script: acme.sh An ACME protocol client written purely in Shell (Unix shell) language. Full ACME protocol implementation. Support ECDSA certs Support SAN and wildcard certs Simple, powerful and very easy to use. You only need 3 minutes to learn it. Bas...
环境变量TMOUT也可以起到同样作用,指定read命令等待用户输入的时间(单位为秒)。 上面例子也是等待3秒,如果用户还没有输入,就会超时。 -p 参数 -p参数指定用户输入的提示信息。 上面例子中,先显示Enter one or more values >,再接受用户的输入。 -a参数 ...
I have read and understand the consequences associated with performing this operation. admin:/diagnose>sys clearnode WARNING: Parameter error! The operation cannot be performed. All parameters must be correct and maximum 2 parameter. Please input: sys.sh clearnode [optype] Parameter interpretation: ...
read -p "输入yes强制安装/Enter yes to force installation (yes/n): " yes; done if [ "$yes" == 'n' ];then exit; fi }Web_Service_Check(){ if [ -f "/etc/init.d/nginx" ]; then nginxV=$(cat /etc/init.d/nginx|grep /www/server/nginx) ...