Hands-on Lab·Red Hat Certified System Administrator
Running Shell Scripts
Not an objective on its own, and assumed by all four that are. Three things stop a new script running and all three are demonstrated: no execute bit, the current directory not being on `PATH`, and the shebang.
Shell Scripts Guide 61 of 67 Beginner
- OSRHEL 10.0 (Coughlan)
- Kernel6.12.0-55.9.1.el10_0
- dnf4.20.0
- Flatpak1.16.0
- TimeAbout 9 min
- Reviewed23 August 2026
Written against the versions above. `#!/usr/bin/bash` and `#!/bin/bash` both work on RHEL - `/bin` is a symlink to `/usr/bin`. `#!/bin/sh` is a *different* request: it asks for POSIX shell behaviour, and bashisms like `[[ ]]` may not work under it.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| RHCSA-A01 | 192.168.0.31 | RHEL 10.0 (Coughlan) | Practice node (graded) - spare /dev/sda | 2 Core | 4 GB | 50 GB + 15 GB |
Before you start
- A shell.
- The session writes and removes
~/scripts.
-
Three ways it fails, and three fixes
-
The shebang