1)接收输入 check_status() { echo --Check hi_repo status is ok? y or n read var if [ "$var" != "y" ] then echo --input is not 'y' exit fi } 1.编写函数check_status,调用时直接写check_status,不用括号: 2.输入read var, 使用时用$var 3.if判断,可以用!=,注意if []的空格: 2)删除空行 #
grep 用法 Usage: grep [OPTION]... PATTERN [FILE]... Search for PATTERN in each FILE or standard input. PATTERN is, by default, a basic regular expression (BRE). Example: grep -i 'hello world' menu.h main.c Regexp selection and interpretation: -E, --ext