The break Statement The break statement allows you to exit the current loop. It is often used in an if statement that is contained within a while loop, with the condition in the while loop always evaluating to true. This is useful if the number of times the loop is executed depends on input from […]
Archives for July 2020
How to use until loop in Shell Scripts
The until Loop The until loop is very similar to the while loop, except that the until loop executes as long as the command fails. After the command succeeds, the loop exits and execution of the script continues with the statement following the done statement. The syntax for the until loop is: until control_command do […]
“while” Loop Examples in Shell Scripts
The while loop allows you to repeatedly execute a group of statements while a command executes successfully. The syntax for the while loop is: while control_command do statement1 … statementN done where, control_command can be any command that exits with a success or failure status. The statements in the body of the while loop can […]
How to enable additional scsi logging in CentOS/RHEL
Question: How to turn on scsi extended debug messages? What are the field/flag definitions of scsi_logging_level? Additional scsi logging messages can be enabled by writing to /proc/sys/dev/scsi/logging_level either via use of the echo or preferably the sysctl command. The kernel parameter consists of ten packed fields, each 3 bits in length. Each field can have […]
chattr Command Examples to Change File Attributes (Make files immutable)
Files can also have attributes that are expressed in another way than the permissions we have seen so far. An example of this is making a file immutable (a fancy word, which means it cannot be changed). An immutable file still has normal ownership and group and RWX permissions, but it will not allow the […]
When to use rescan-scsi-bus.sh -i (LIP flag) in CentOS/RHEL
The “rescan-scsi-bus.sh” can be used to scan new LUNs in a CentOS/RHEL machine. When ‘rescan-scsi-bus.sh -i’ is run, script execute as well a LIP_RESET (ISSUE_LIP) which may cause a disruption in I/O on the server and even cause an outage in case of a system running on heavy load. What is LIP (Loop Initialization Protocol)? […]
How to Disable rpc.quotad Service in CentOS/RHEL 6 and 7
This post explains how to disable rpc.quotad service on CentOS/RHEL 6 or 7 machines. The protocol used by rpc.rquotad is an unsecured and obsolete protocol and should be disabled. Note: This procedure can disrupt NFS clients relying on disk quotas. To avoid issues, schedule a maintenance outage and stop these NFS clients. For CentOS/RHEL 6 […]