reworking content
All checks were successful
learn org at code.softwareshinobi.com/linux.softwareshinobi.com/pipeline/head This commit looks good
All checks were successful
learn org at code.softwareshinobi.com/linux.softwareshinobi.com/pipeline/head This commit looks good
This commit is contained in:
45
landing/docs/Bash-Scripts/003-bash-hello-world.md
Normal file
45
landing/docs/Bash-Scripts/003-bash-hello-world.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# Hello World Bash
|
||||
|
||||
Let's build your first script. Create `shinobi.sh` and add the essential shebang, followed by your `Hello World` message:
|
||||
|
||||
```bash
|
||||
touch shinobi.sh
|
||||
```
|
||||
|
||||
Now, open `shinobi.sh` and add this content:
|
||||
|
||||
```bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "Hello World!"
|
||||
```
|
||||
|
||||
Save and close the file.
|
||||
|
||||
Next, make your script executable:
|
||||
|
||||
```bash
|
||||
chmod +x shinobi.sh
|
||||
```
|
||||
|
||||
Execute your script directly:
|
||||
|
||||
```bash
|
||||
./shinobi.sh
|
||||
```
|
||||
|
||||
You'll see "Hello World!" printed.
|
||||
|
||||
Alternatively, you can run the script by explicitly calling the `bash` interpreter:
|
||||
|
||||
```bash
|
||||
bash shinobi.sh
|
||||
```
|
||||
|
||||
For quick tests, `echo` works directly in your terminal:
|
||||
|
||||
```bash
|
||||
echo "Hello Shinobi!"
|
||||
```
|
||||
|
||||
Scripts become powerful when combining multiple commands for automated tasks. This is your first step.
|
||||
Reference in New Issue
Block a user