B
Babs
Guest
LearnBashScriptingWithMe
Day 1 β Introduction, Shebang & File Permissions
Bash scripting is the process of creating a file that contains a sequence of commands and then running that file as a script.
A shell in Kali Linux is a command-line interpreter that provides an interface for the user to interact with the operating system. It allows users to execute commands, scripts, and programs to manage the system, navigate the file system, and perform various administrative tasks.


Code:
#!/bin/bash

Code:
echo "Hello World!"


e.g:
Code:
./test.sh
Note that the command "./" is telling the shell to use the interpreter defined in the file we want to run which was what was defined first when we wrote "#!/bin/bash" in the file
But noticeβyou might get a βpermission deniedβ error. Thatβs because the file isnβt yet executable.


Code:
chmod +x test.sh
Now, when you run ./test.sh, the script executes successfully


Bash #scripting
Continue reading...