Using the cat command with the output character > to output multiple lines of text in a bash script is the most straightforward approach.
Cat >out.file <<eof
Start a line
...
...
A line again
Eof
Note that EOF, as an identifier, marks the beginning and end of the text, which can be any character, but must not be duplicated with the text content.
Can also be written as:
Cat <<eof >out.file
Start a line
...
...
A line again
Eof
Second, the entire selection of vim.
1, $y Copy all, not select all
DG This is the deletion of the line from the cursor to the last line (including the contents of the line where the cursor is located)
GGVG Select All
Explain the above command.
GG allows the cursor to move to the first line, the VIM is valid, VI is not valid
V is entering visual (visual) mode
G cursor moves to the last line
After selecting the content, you can do something else, such as:
D Delete Selection
Y Copy the selection to number No. 0 register
"+y Copy the selection to the + register, which is the clipboard of the system for other programs
Bash's output multi-line and Vim's full selection