Unix tip of the day
Oct. 26th, 2007 03:57 pmFor years I've taken advantage of the fact that one can use the "+" option in "vi" to have the editor open up at a particular position:
Example: Open the file file.txt for editing and position cursor at the 5th line:
Today I saw a shell script that opened to line "$" which positions the cursor at the last line. It's obvious that it would work ("$" means "last line" in the vi command line) but I had never thought of it:
Example: Open the file file.txt for editing and position cursor at the 5th line:
vi +5 file.txtToday I saw a shell script that opened to line "$" which positions the cursor at the last line. It's obvious that it would work ("$" means "last line" in the vi command line) but I had never thought of it:
vi +$ file.txt