在使用 awk 时我注意到了这种行为:
[root@ror6ax3 ~]# grep open * | awk '$2 ~ /opens*/ {print $0}'
install.log:Installing openldap-2.4.23-32.el6_4.1.x86_64
install.log:Installing openssl-1.0.1e-15.el6.x86_64
install.log:Installing openssh-5.3p1-94.el6.x86_64
install.log:Installing openssh-clients-5.3p1-94.el6.x86_64
install.log:Installing openssh-server-5.3p1-94.el6.x86_64
install.log:Installing b43-openfwwf-5.2-4.el6.noarch
[root@ror6ax3 ~]# grep open * | awk '$2 ~ /opens */ {print $0}'
install.log:Installing openssl-1.0.1e-15.el6.x86_64
install.log:Installing openssh-5.3p1-94.el6.x86_64
install.log:Installing openssh-clients-5.3p1-94.el6.x86_64
install.log:Installing openssh-server-5.3p1-94.el6.x86_64
为什么会opens*
匹配openldap
?