代码搜索结果
找到约 10,000 项符合
L 的代码
l18.1a
#print
Sometimes it is desirable to add text before a
known line, rather than after it. For this purpose
there is an 'i' (insert) command that places the new
material before the specified line. Other
l60.1a
#print
So far you have always dealt with one file at a time. Suppose you
wanted to combine two files - there is nothing we have covered so far
that will do that. But the editor does have a command '
l44.1a
#print
You have now learned quite a bit about substitute commands.
Here is a larger task to perform. There is a file 'song' in
this directory. Edit it; print it out, and notice that
there are six mi
l3.1a
#print
The editor accepts commands one per line,
just like the other programs in UNIX; but its
commands are unique to it.
Like the normal command interpreter,
the editor has a prompt sign to let you k
l35.2a
#print
The '*' character is also used in the editor patterns (the regular
expressions) but it has quite a different meaning from '*'
as used in filenames. In the editor it means "any
number of repeti
l13.2a
#print
Remember that "$" is the last line in
the current file. Suppose you want to
know how long the file is, i.e. what the
number of the last line is. The command
$=
will tell you that. So you c
l54.1a
#print
A time-saving feature of context searches is
that the editor remembers the last regular expression
mentioned, and if you just say // or ??
with no expression, it assumes the same one. Thus
/a
l71.1a
#print
After the global command has selected the lines
to which the second command is to be applied, it sets '.' (the
current line) to each of these lines in turn as it executes
the controlled command
l15.2a
#print
So far you have learned how to
copy and print existing files, and now
you probably want to know how to add new text
to a file. The "a" (append) command lets
you do that. For example, the sequ
l41.1a
#print
One thing you must be careful of is that the substitute command does not
know about word boundaries. It will change the first occurrence of a
letter string it matches without regard to blanks