The three n commands cause the next three lines to be appended to our current pattern space buffer , and now our line looks like this 这三个n命令导致将下三行附加到当前模式空间缓冲区,现在这一行看起来如下:
The h command puts this back in the hold space for safekeeping , and d deletes the line from the pattern space so that it isn t printed H命令将该内容放回保留空间保护起来,然后, d从模式空间删除该行,以便不打印它。
You ll also notice that we ve replaced the d command with the p command , which as you might guess , explicitly commands sed to print the pattern space 您还会注意到,我们用p命令替换了d命令,如您所猜想的那样,这明确要求sed打印模式空间。
Then , the d command is executed , which deletes " foo " from the pattern space , so it doesn t get printed after all the commands are executed for this line 然后,执行d命令,该命令从模式空间中删除" foo " ,以便在对这一行执行完所有命令之后不打印它。
This command tells sed to copy the contents of the pattern space the buffer that holds the current line being worked on to the hold space a temporary buffer 该命令告诉sed将模式空间(保存正在处理的当前行的缓冲区)的内容复制到保留空间(临时缓冲区) 。