代码搜索结果
找到约 10,000 项符合
L 的代码
l12.3a
#print
Another thing about the 'w' command is that if you
just want to write a file and quit,
you can put the
w
q
on the same line, as in
wq
Make a copy of the file 'harry' in a file named 'norman
l40.1a
#print
There is also a special character which indicates
the end of the line. It is '$'. So that
s/ab$/xy/
changes 'ab' to 'xy' only if 'ab' ended the line.
In the file 'text' there are some lines
l33.1a
#print
When you want to match one of a few specific characters, and not
just any character, the pattern is similar to the pattern used
in filenames. The patterns used with the editor, by
the way, are
l74.1a
#print
Here's a last review exercise. In the file "cities" is a list
of cities with populations and Zip codes. The following cities
were omitted: add them in alphabetical order
St. Louis 622,236
l9.2a
#print
You can print several lines at once by
using commands like
1,3p
which prints lines 1, 2 and 3. Again,
I'll put you into the editor. Print
lines 1 to 3 of the file; then type
w, q and ready
l13.3a
#print
The 'nu' command works the same way as 'p',
except that it puts the line number to the
left of each line that it prints.
I will put you in the editor with the file 'henry'. Type
1,$nu
and t
l0
#next
1.1a 10
l32.1a
#print
Just as you can specify files with an abbreviation,
it is also possible, in the 's' command, to
use an abbreviation for the string to be used
for substitution. Unfortunately, the characters
us
l73.1a
#print
Back early in this sequence we made clear that
the shell (the normal command interpreter) and the
editor were distinct and they didn't pay any attention
to each other's commands.
Sometimes you
l57.1a
#print
For symmetry, you can use
+
instead of either ".+1p" or an empty line (just a newline).
The only advantage that + has is that you can repeat it:
++
prints the second following line, and
+