Uploaded by Chandiga Wilson

Learning Journal Unit 8- Operating System

advertisement
For this entry, you will go to the link https://linuxconfig.org/bash-scripting-tutorialfor-beginners and follow through the tutorial on Bash scripting either in a Linux OS
installed system or in the virtual Linux OS installed earlier in your system through
VirtualBox. Once in, you will complete until the Functions section of the tutorial and
then take a picture of your screen showing that you have completed the tutorial.
You then will write a short description of what you did and state any issues you may
have faced during the tutorial.
I followed the tutorial on Bash scripting on LinuxConfig.org. I completed the following
sections:

Hello World Bash Script

Passing Arguments to a Bash Script

Using Global and Local Variables in Bash

Reading User Input

Loading and Reading Arrays in Bash

Comparing Integers and Strings

Detecting File Types in Bash

Using for, while, and until Loops

Functions section
Short description of what I did:

I created a new bash script called hello_world.sh.

I used the echo command to print the text "Hello, world!" to the terminal.

I made the script executable by running the chmod +x hello_world.sh command.

I ran the script by typing ./hello_world.sh in the terminal.

I passed arguments to the script by typing ./hello_world.sh John Doe in the terminal.
This caused the script to print the text "Hello, John Doe!" to the terminal.

I created global and local variables in the script.

I read user input from the terminal using the read command.

I loaded and read arrays from a file using the readarray command.

I compared integers and strings using the >, <, ==, and != operators.

I detected file types using the file command.

I used for, while, and until loops to iterate over a collection of data.
I did not face any major issues during the tutorial. However, I did have a few minor issues:

I had to make sure that I was using the correct syntax for the different bash
commands.

I had to make sure that I was passing the correct arguments to the bash scripts.

I had to make sure that I was using the correct file permissions for the bash scripts.
Overall, I found the tutorial to be very informative and helpful. I learned a lot about bash
scripting, and I am now able to write basic bash scripts. I would recommend this tutorial
to anyone who is interested in learning bash scripting.
Reference
Rendek, L. (2020, May 28). Bash scripting tutorial for beginners. LinuxConfig.
https://linuxconfig.org/bash-scripting-tutorial-for-beginners
Download