The Shell is a layer between the Operating System(OS) and the user.🐚 It is a user interface for access to the operating system and it uses either a command-line interface (CLI) or a graphical user interface (GUI). In Linux and MacOS this CLI is called Terminal, in Windows Command Prompt.
You can write scripts for the shell which can be used for various purposes, such as executing a shell command, running multiple commands together or performing task automation.
It's easy to get started with shell scripting, let`s create a “hello world” shell script for Linux:
- Open an editor and write:
#!/bin/bash echo "Hello World"
- Save it with a name of your choice with .sh at the end. (I chose “hello.sh”)
- Open your Terminal at the path where you saved the file.
chmod +x hello.shto make the file executable.
- Execute “./hello.sh”
Thats it! What are you up to today? Anything you want to share about the Shell? Have a nice day!😊