Question about sed
Below is the output from my LPIC book I am stuck because I dont understand what the Addresses mean in this Table 1.4. Can anyone explain what they mean by 0 or 1?
"The sed command directly modifies the contents of files, sending the changed file to standard output. Its syntax can take one of two forms:
sed [options] -f script-file [input-file]
sed [options] script-text [input-file]
In either case, input-file is the name of the file you want to modify. (Modifications are temporary unless you save them in some way, as illustrated shortly.) The script (script-text or the contents of script-file) is the set of commands you want sed to perform. When you pass a script directly on the command line, the script-text is typically enclosed in single quote marks. Table 1.4 summarizes a few sed commands that you can use in its scripts.
TABLE 1.4 Common sed commands
Command Addresses Meaning
= * 0 or 1 Display the current line number.
a\text * 0 or 1 Append text to the file.
i\text * 0 or 1 Insert text into the file.
r filename * 0 or 1 Append text from filename into the file.
c\text * Range Replace the selected range of lines with the provided text.
s/regexp/repl * Range Replace text that matches the regular expression (regexp) with replacement.
w filename * Range Write the current pattern space to the specified file.
q * 0 or 1 Immediately quit the script, but print the current pattern space.
Q * 0 or 1 Immediately quit the script.
"
Last edited by HWDPlinux; 04-01-2014 at 07:42 PM.
|