代码搜索结果
找到约 10,000 项符合
L 的代码
l51.1a
#print
You can also use relative addresses of the +1 or -1
sort with context searches. For example, to
print the line after a line containing "cat",
you can say
/cat/+1p
How would you print the lin
l50.1a
#print
So far all the addresses you have used have been
either line numbers, '$', or '.' (or combinations
thereof). The most useful addresses are none of
those, but are specifications of lines by con
l37.2a
#print
A range of line numbers can be used with the substitute
command as with the print command. For example,
$-4,$s/cat/&s/p
will change "cat" into "cats" on the last five lines of
a file. In th
l53.1a
#print
Note that the // searches always go forward.
Sometimes you want to go backward, to find
some expression on a line before the
one you are now working on.
In that case you can search with a comma
l20.01a
#print
Now that you know how to delete lines,
you may eventually delete some by mistake.
If you just deleted some lines, you can always recover them
with the 'u' command. For example,
1,5d
u
wi
l70.2a
#print
Perhaps the most powerful editor command is the 'g'
(global) command. This command selects sets of lines
on which other commands are executed. For example,
g/abc/p
prints all lines on which
l55.1a
#print
This is an easy unit. If you just hit
"newline" (or "carriage return", whatever it
is labeled on your terminal), the
editor will simply print the next line
as you can see by trying this out.
l12.2a
#print
Each 'w' command typed so far has written the edited material
back on the same file that it came from originally.
This can be changed by giving a filename on the 'w' command:
w camden
will wr
l5.1a
#print
(Section 1.5)
Write a program that copies exactly three characters
from its input to its output.
When compiled and tested, type ready.
#once #create Ref
XY
#once #create z1
XY
marks the spot.
#
l35.1a
#print
Write a program which prints the number of vowels
(instances of 'a', 'e', 'i', 'o', and 'u')
in the input.
#once #create Ref
hoboken harrison newark roseville avenue grove street
east orange br