Unix Power ToolsUnix Power ToolsSearch this book

17.12. Appending to an Existing File

You can use the Unix redirect and append operator (>>) with w to append all or part of the buffer's contents to an existing file. For example, if you entered:

:1,10w newfile

and then:

$ Section 20.3

:340,$w >>newfile

newfile would contain lines 1-10 and line 340 to the end of the buffer.

--TOR, from Learning the vi Editor (O'Reilly, 1998)



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.