Previously I’ve shown how to use the bash while loop in a bash script. Today I’m going to show how to use another type of do loop in bash: the for loop. The for loop is a little different from the other looping structures in bash. The other loop structures work by evaluating whether an …
Continue reading Bash to Basics: The For Loopbash
There are times when you will want to trim some information from the output of a command. This may be because you want to feed that output into another command. Whatever the reason for wanting to manipulate the output, awk is one of many tools available in GNU/Linux to perform this task.
Continue reading Command Line Basics: Cut Fields With awkThe While Do Loop One of the most common structures in programming is the Do Loop. The version that I’m going to show today is the While Do Loop. The basic structure of the While Do Loop is: while condition A exists, execute the loop. Here’s an example program that counts to ten and then …
Continue reading Bash to Basics: The While Do LoopOne of the most powerful features of the Linux command line interface, (and other shells that conform to the POSIX standard) is the ability to pipeline output from one command as the input to another. This is done using the vertical bar or pipe character [ | ].
Continue reading Command Line Basics: Pipelining OutputIn today’s command line basics, I’m going to show you how to redirect output from the bash cli (command line interface). The output of most GNU command line tools is normally sent to the terminal (ie – standard output). There are times when you would like to have the output saved as a file. Now, …
Continue reading Command Line Basics: Redirecting Output