Tsallaka zuwa abun ciki
Justice Tech School

Running Scripts

Save commands in a file, start it with a shebang line such as #!/bin/bash, make it executable with chmod +x and run it with ./script.sh. You can also run bash script.sh.

Example
#!/bin/bash
echo "Hello from a script"

# Terminal:
#   chmod +x hello.sh
#   ./hello.sh

Exercise

Make a file executable.

chmod  hello.sh

Quiz Test

What does the shebang line do?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.