我在mac OS上使用sed命令,下面是文本。BSD sed:d命令末尾的多餘字符
$ cat pets.txt
This is my cat
my cat's name is betty
This is your dog
your dog's name is frank
This is your fish
your fish's name is george
This is my goat
my goat's name is adam
當我運行:(BSD SED)
$ sed '3,6 {/This/d}' pets.txt
它顯示錯誤:
sed: 1: "3,6 {/This/d}": extra characters at the end of d command
有什麼錯呢?當我使用gsed(GNU sed)
時,它運行良好。