Filtering programs

When we establish long pipelines, we sometimes want to add an extra "link" into the pipeline to reformat or filter the data in some way before passing it on to the next program, and we may find that there are no programs available to us on the system that filter the text in exactly the way we need.

We may therefore wish to use something with a bit more power; we'll look at the sed and AWK programming language interpreters, both of which are specified by POSIX. They are ideal tools to write short one-line programs dedicated to filtering text streams in novel ways.

We can't completely explain sed and AWK here, but we'll give some examples that will demonstrate the sort of tasks for which they are ideal. Like many other commands useful in Bash scripts, neither of these programs are part of Bash itself; they're just very often used in Bash and other shell script command lines.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.102.6