Shell脚本:读取内容并判断是否包含“2J”
#!/bin/bash
while true; do read -p '请输入内容:' content if [[ '$content' == '2J' ]]; then echo '输入的内容包含2J,输出2J的内容:' echo '2J的内容' break else echo '输入的内容不包含2J,请重新输入' fi done
原文地址: https://www.cveoy.top/t/topic/nVB5 著作权归作者所有。请勿转载和采集!