options.sh

来自「linux平台中」· Shell 代码 · 共 37 行

SH
37
字号
#!/bin/sh# Test for POSIX.2 options for grep## grep [ -E| -F][ -c| -l| -q ][-insvx] -e pattern_list #      [-f pattern_file] ... [file. ..]# grep [ -E| -F][ -c| -l| -q ][-insvx][-e pattern_list]#      -f pattern_file ... [file ...]# grep [ -E| -F][ -c| -l| -q ][-insvx] pattern_list [file...]#: ${srcdir=.}failures=0# checking for -E extended regexecho "abababccccccd" | ${GREP} -E -e 'c{3}' > /dev/null 2>&1if test $? -ne 0 ; then        echo "Options: Wrong status code, test \#1 failed"        failures=1fi# checking for basic regexecho "abababccccccd" | ${GREP} -G -e 'c\{3\}' > /dev/null 2>&1if test $? -ne 0 ; then        echo "Options: Wrong status code, test \#2 failed"        failures=1fi# checking for fixed string echo "abababccccccd" | ${GREP} -F -e 'c\{3\}' > /dev/null 2>&1if test $? -ne 1 ; then	echo "Options: Wrong status code, test \#3 failed"	failures=1fiexit $failures

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?