-
Book Overview & Buying
-
Table Of Contents
Linux Shell Scripting Essentials
By :
The sed command is a non-interactive stream editor that allows you to modify the content of the standard input or file. It performs an operation on each line in a pipeline. The syntax will be:
sed [OPTIONS]... {script} [input-file …]
By default, the output is displayed on stdout, but can be redirected to a file if specified.
The input-file are the files on which sed needs to be run. If no files are specified, it reads from stdin.
The script can be a command or a file with multiple commands to pass to sed, and OPTIONS to sed are described in the following table:
|
Option |
Description |
|---|---|
|
-n |
This suppresses automatic printing of pattern space |
|
-e script |
This allows multiple scripts to be executed |
|
-r |
This uses the extended regex in the script |
|
-l N |
This specifies line wrap length |
|
--posix |
This disables all GNU extensions |
|
-u |
This loads the minimal amounts of data from input and flushes output buffers frequently |
The sed command is widely used...
Change the font size
Change margin width
Change background colour