Reputation: 35734
What is the best way to output the date into a file plus a blank line and have vi ready to go at the new line:
So far i have:
date >> myfile && vi myfile
But it doesnt do 2 things:
Upvotes: 0
Views: 108
Reputation: 364288
Initial editing position:
+[num]
starts editing at the specified line number, or EOF if omitted. Many editors support this, so they can be invoked from less
at the current view position.
Getting an extra newline:
Either use a custom format for date
that ends with two newlines, or do:
{ date && echo; } >> myfile && vi + myfile
Upvotes: 4