Stream Editor – Useful Recipes
SED is an amazing utility that allows multiple ways to solve a problem. This is the UNIX way and SED perfectly proves that. GNU/Linux provides many useful utilities to perform…
SED is an amazing utility that allows multiple ways to solve a problem. This is the UNIX way and SED perfectly proves that. GNU/Linux provides many useful utilities to perform…
It is the regular expressions that make SED powerful and efficient. A number of complex tasks can be solved with regular expressions. Any command-line expert knows the power of regular…
We have already discussed the use of pattern and hold buffer. In this chapter, we are going to explore more about their usage. Let us discuss the n command which prints the…
Substitute Command Text substitution operations like "find and replace" are common in any text editor. In this section, we illustrate how SED performs text substitution. Given below is the syntax…
SED provides two special characters which are treated as commands. This chapter illustrates the usage of these two special characters. = Command The "=" command deals with line numbers. Given…
This chapter describes several useful SED commands. Delete Command SED provides various commands to manipulate text. Let us first explore about the delete command. Here is how you execute a delete command:…
In the previous chapter, we learnt how SED handles an address range. This chapter covers how SED takes care of a pattern range. A pattern range can be a simple…
One of the basic operations we perform on any file is display its contents. For this purpose, we can use the print command which prints the contents of the pattern buffer. So…
Branches can be created using the t command. The t command jumps to the label only if the previous substitute command was successful. Let us take the same example as in the…
Like other programming languages, SED too provides a looping and branching facility to control the flow of execution. In this chapter, we are going to explore more about how to…