Operating Systems & Administration

[Day 6] 1. Spacing in Shell Scripting

D
DITISS Admin
••1 min read

Assignment Operator

  • When writing a variable assignment, there should not be any spaces between the variable name, assignment operator (
    =
    ), and the value.
    • Correct:
      val=10
    • Incorrect:
      val = 10

Operators

  • When using operators, spaces should be included between operands and operators.
    • Correct:
      <operator1> <operand> <operator2>
    • Incorrect:
      <operator1><operand><operator2>

Conditional Statements

  • When writing an

    if
    statement, there should be spaces:

    1. After
      if
    2. Before and after the condition inside the brackets.
    • Correct:
      if [ condition ]
    • Incorrect:
      if[condition]
      (This generates an error)

Read Next

8/26/2026

[Day 6] 2. Types of Kernel

### **1. Monolithic Kernel** A **monolithic kernel** is an operating system architecture where the entire kernel operates as a single large program...

8/26/2026

[Day 6] 3. Shell Scripting again

## **Types of Loops in Shell Scripting** 1. **For Loop** 2. **While Loop** 3. **Until Loop** 4. **Select Loop** --- ### **1. While Loop**...