我在Mac OS上使用sed命令,下面是文本。
$ 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)
时,它运行良好。