Linux Tip of the Day (Beginner Bash Scripting): 💻🗒️
Always start your script with #!/bin/bash.
That first line is called a shebang (#!). It tells Linux which program should run the script. Without it, your script might not run correctly.
Example:
#!/bin/bash
echo "Hello, world!"
Steps to run it:
Save it as hello.sh.
Make it executable:
chmod +x hello.sh
Run it:
./hello.sh
Output:
Hello, world!
👉 Without the #!/bin/bash line, Linux will use the shell of the session you are logged into.
6
2 comments
Michael Sanderson
3
Linux Tip of the Day (Beginner Bash Scripting): 💻🗒️
powered by
Linux Infrastructure Academy
skool.com/linux-infrastructure-academy-5525
Master Linux infrastructure and DevOps skills with hands-on labs, tools, and community support. Build smarter, faster, and more secure systems.
Build your own community
Bring people together around your passion and get paid.
Powered by