检查尾部输出时案例不起作用

Case doesn't work when examining tail output

我无法找到我的 case 语句在查看尾部输出时不起作用的原因。

tail -F -n1 /var/log/pihole.log |
while read input; do
 echo "$input" | hexdump -C            # just to physically compare the output
 case $input in
   cached|blacklisted|blocked)
     echo "We have a match!";;
   *)
     echo "No match!"
 esac
done

这总是returns No match!,即使字符串在$input.

:~ $ ./pihole_test.sh
00000000  4a 61 6e 20 31 20 31 31  3a 35 35 3a 35 38 20 64  |Jan 1 11:55:58 d|
00000010  6e 73 6d 61 73 71 5b 36  39 36 5d 3a 20 65 78 61  |nsmasq[696]: exa|
00000020  63 74 6c 79 20 62 6c 61  63 6b 6c 69 73 74 65 64  |ctly blacklisted|
00000030  20 70 6c 61 79 2e 67 6f  6f 67 6c 65 2e 63 6f 6d  | play.google.com|
00000040  20 69 73 20 30 2e 30 2e  30 2e 30 0a              | is 0.0.0.0.|
0000004c
No match!

替换

cached|blacklisted|blocked)

*cached*|*blacklisted*|*blocked*)

匹配子字符串。