From 326e4bdae89a510bed30fe472e4089a379ea4b94 Mon Sep 17 00:00:00 2001 From: newrain001 Date: Sat, 24 Feb 2024 16:24:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'os/check1.sh'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- os/check1.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/check1.sh b/os/check1.sh index 78d0ffc..9018176 100644 --- a/os/check1.sh +++ b/os/check1.sh @@ -19,7 +19,7 @@ check_command "id tom &>/dev/null && id jack &>/dev/null && grep hr /etc/group & check_command "[ -d /opt/myfile ] && [ -f /opt/myfile/hello.txt ] && [ -f /opt/world.txt ]" 3 # 4. 检查world.txt文件是否包含abcde字符串,且重复10行 -check_command "grep -Fxq 'abcde' /opt/world.txt && [ \$(grep -c 'abcde' /opt/world.txt) -eq 10 ]" 4 +check_command "grep -Fxq 'abcde' /opt/world.txt && [ \$(grep -c 'abcde' /opt/world.txt) -ge 10 ]" 4 # 5. 检查world.txt文件的属主是否为jack,属组是否为hr check_command "[ \$(stat -c '%U' /opt/world.txt) = 'jack' ] && [ \$(stat -c '%G' /opt/world.txt) = 'hr' ]" 5