我期望这两个 sed 命令是等效的,但mozilla/DST_Root_CA_X3.crt
仅在第二种情况下被删除,为什么?
如果重要的话,我正在使用 sed 4.4 和 Debian Stretch
(stretch-arm64)ubuntu@ip-10-1-2-224:~$ sudo sed '#^mozilla/DST_Root_CA_X3.crt$#d' test-certificates.conf
mozilla/Verisign_Class_3_Public_Primary_Certification_Authority_-_G3.crt
mozilla/XRamp_Global_CA_Root.crt
mozilla/certSIGN_ROOT_CA.crt
mozilla/ePKI_Root_Certification_Authority.crt
mozilla/emSign_ECC_Root_CA_-_C3.crt
mozilla/emSign_ECC_Root_CA_-_G3.crt
mozilla/emSign_Root_CA_-_C1.crt
mozilla/emSign_Root_CA_-_G1.crt
mozilla/DST_Root_CA_X3.crt
(stretch-arm64)ubuntu@ip-10-1-2-224:~$ sudo sed '/^mozilla\/DST_Root_CA_X3.crt$/d' test-certificates.conf
mozilla/Verisign_Class_3_Public_Primary_Certification_Authority_-_G3.crt
mozilla/XRamp_Global_CA_Root.crt
mozilla/certSIGN_ROOT_CA.crt
mozilla/ePKI_Root_Certification_Authority.crt
mozilla/emSign_ECC_Root_CA_-_C3.crt
mozilla/emSign_ECC_Root_CA_-_G3.crt
mozilla/emSign_Root_CA_-_C1.crt
mozilla/emSign_Root_CA_-_G1.crt
Run Code Online (Sandbox Code Playgroud) sed ×1