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.