Shell 脚本:键盘输入数据处理 (exit 退出,小于 100 打印值)
#!/bin/bash
while true; do read -p '请输入数据: ' data if [[ '$data' == 'exit' ]]; then break elif [[ $data -lt 100 ]]; then echo '值为: $data' else echo 'other' fi done
原文地址: https://www.cveoy.top/t/topic/pf5Z 著作权归作者所有。请勿转载和采集!