All checks were successful
learn org at code.softwareshinobi.com/linux.softwareshinobi.com/pipeline/head This commit looks good
24 lines
664 B
Markdown
24 lines
664 B
Markdown
# Bash Basics
|
|
|
|
To begin, create a new file with a `.sh` extension. We'll use `shinobi.sh` as our example.
|
|
|
|
You can create it instantly with `touch`:
|
|
|
|
```bash
|
|
touch shinobi.sh
|
|
```
|
|
|
|
Or, open it directly in your text editor:
|
|
|
|
```bash
|
|
nano shinobi.sh
|
|
```
|
|
|
|
For your script to execute, the very first line must specify the interpreter. This is called the Shebang. While `#!/bin/bash` instructs the operating system to use `/bin/bash`, its location can vary. For wider compatibility, use this:
|
|
|
|
```bash
|
|
#!/usr/bin/env bash
|
|
```
|
|
|
|
This tells the system to find `bash` within your `PATH` environment variable, ensuring your script runs consistently across different systems.
|