Closed Will513r closed 12 months ago
Created a shell script that prints hello world which is a variable using nano
to create the auto sh file. echo
to print and chmod
to make it executable.
#!/bin/bash
message="hello world"
echo $message
šš»
Summary
Learn how to write a simple shell script to automate a series of commands. This introduction will cover the basics of scripting, including variables, loops, and conditionals.
Description
Objective: Acquire the skills to write a basic shell script that can automate tasks, use variables, and incorporate simple control structures like loops and conditionals.
Scope:
Learning Tasks
Introduction to Shell Scripting:
Writing a Basic Script:
Running a Shell Script:
Hands-on Practice:
.sh
extension. Add the shebang line at the top,#!/bin/bash
.chmod +x script_name.sh
and run it with./script_name.sh
.Troubleshooting:
Learning Goals
Priority