Unix, Linux, DevOps , Cloud computing and BigData Knowledge-Base
You can use the STDOUT and STDERR file descriptors in your scripts to produce output in multiple locations simply by redirecting the appropriate file descriptors. There are two methods for redirecting output in the script: Temporarily redirecting each line Permanently redirecting all commands in the script...
The most basic method of passing data to your shell script is to use command line parameters. Command line parameters allow you to add data values to the command line when you execute the script: $ ./addem 10 30 This example passes two command line parameters...
System Access, Authentication and Authorization In this post we will discuss about the Configuration and Tuning of RHEL6 System Access, Authentication and Authorization.
Now that you’ve seen how to use the different ways to create loops in shell scripts, let’s look at some practical examples of how to use them. Looping is a common way to iterate through data on the system, whether it’s files in folders or data...
You might be tempted to think that after you start a loop, you’re stuck until the loop finishes all its iterations. This is not true. A couple of commands help us control what happens inside of a loop: The break command The continue command Each command...
Often, you must iterate through items stored inside a file. This requires combining two of the techniques covered: Using nested loops Changing the IFS environment variable By changing the IFS environment variable, you can force the for command to handle each line in the file as...
The until command works in exactly the opposite way from the while command. The until command requires that you specify a test command that normally produces a nonzero exit status. As long as the exit status of the test command is non-zero, the bash shell executes...
Iterating through a series of commands is a common programming practice. Often, you need to repeat a set of commands until a specific condition has been met, such as processing all the files in a directory, all the users on a system, or all the lines...
Often, you’ll find yourself trying to evaluate a variable’s value, looking for a specific value within a set of possible values. In this scenario, you end up having to write a lengthy if-then-else statement, like this:
We know time is so important in your busy weekdays and Family Weekends, and that’s the reason we made a course that makes you an expert in Red Hat Enterprise Linux 7 , with just 15 minutes each day. Doesn’t matter whether you are commuting to...