• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Archives for July 2020

Using Loops (while, for) in awk scripts

by admin

The awk programming language contains many of the programming concepts that are used in shell scripting. Conditionals, such as the if statement and loops, such as the following can also be used in awk programming. The while loop The do while loop The for loop The if Statement The if statement can have two branches: […]

Filed Under: DevOps, Shell Scripting

Beginners Guide to Using “trap” to Catch Signals and Handle Errors in Shell Script

by admin

Shell Signal Values A signal is a message that some abnormal event has taken place or a message requesting another process do something. The signal is sent from one process to another process. Typically, a process sends a signal to one of its own subprocesses. You can obtain more information on signals from the signal […]

Filed Under: DevOps, Shell Scripting

How to Make a Variable read-only (constant) in Bash and Korn Shell

by admin

Creating Bourne Shell Constants A variable can be made read-only with the following syntax: readonly var[=value] The square brackets around =value mean that the assignment of a value is not always necessary. For instance, if the variable had previously been created and assigned a value, and you now want to make it read-only (and not […]

Filed Under: DevOps, Shell Scripting

Examples of “shift” Command in Shell Scripts

by admin

The shift Statement Sometimes a script does not require a specific number of arguments from users. Users are allowed to give as many arguments to the script as they want. In these situations, the arguments of the script are usually processed in a while loop with the condition being (($#)). This condition is true as […]

Filed Under: DevOps, Shell Scripting

Korn Shell select Loop

by admin

The select statement in the Korn shell creates a menu. This construct is for the Korn shell only. The syntax for creating a menu is: select var in list do statement1 … statementN done The variables var and list follow the same syntactic rules used in the for loop (although the operation of the select […]

Filed Under: DevOps, Shell Scripting

How to use “break” and “continue” statements in shell scripts

by admin

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 […]

Filed Under: DevOps, Shell Scripting

How to use until loop in Shell Scripts

by admin

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 […]

Filed Under: DevOps, Shell Scripting

“while” Loop Examples in Shell Scripts

by admin

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 […]

Filed Under: DevOps, Shell Scripting

Understanding MySQL Query Cache

by admin

What is MySQL Query Cache MySQL server features Query Cache Feature for a long time. When in use, the query cache stores the text of a SELECT query together with the corresponding result that is sent to a client. If another identical query is received, the server can then retrieve the results from the query […]

Filed Under: mysql, MySQL Cluster

How to enable additional scsi logging in CentOS/RHEL

by admin

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 […]

Filed Under: CentOS/RHEL 5, CentOS/RHEL 6, CentOS/RHEL 7, CentOS/RHEL 8, Linux

« Previous Page
Next Page »

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright