# Your First Script

A script is an application: write one, run it, and put it where you can run it from anywhere.

Updated: November 10, 2026

## [Scripts](https://www.ask-codey.com/courses/bash-in-depth/topics/bash-scripts)

1. [A Script Is an Application](https://www.ask-codey.com/lessons/bash-scripts-are-applications) (Novice): Every application takes something in, does some work and gives something back, and a bash script does the same from a text file of commands you can read, which makes it a quick-run application of your own, best at jobs made of files, folders and other programs.
2. [Your First Script](https://www.ask-codey.com/lessons/bash-your-first-script) (Apprentice): A script is a file of commands that starts with the shebang line #!/usr/bin/env bash and explains itself in comments; chmod +x lets it run, and ./ and its name runs it from the folder it's in.
3. [Run It from Anywhere: ~/bin on Your PATH](https://www.ask-codey.com/lessons/bash-scripts-on-your-path) (Apprentice): Copy a finished script into ~/bin without its .sh, put ~/bin on your PATH, and it runs by name from any folder like any other command, as long as the paths inside it work from anywhere and its name isn't already taken, which type checks.

## [A Better Editor](https://www.ask-codey.com/courses/bash-in-depth/topics/bash-a-better-editor)

1. [Writing Scripts in VS Code](https://www.ask-codey.com/lessons/bash-scripts-in-vs-code) (Apprentice): VS Code is a free editor for Windows, Mac and Linux; code . opens the folder you're in, the free ShellCheck extension underlines mistakes in a script as you type, and its built-in terminal runs the script without leaving the editor, though nano still works.

## [Exercise: A Morning Start-Up Script](https://www.ask-codey.com/courses/bash-in-depth/topics/exercise-bash-a-morning-start-up-script)

1. [Exercise: A Morning Start-Up Script](https://www.ask-codey.com/lessons/exercise-bash-a-morning-start-up-script) (Apprentice): Write morning.sh, a script that greets whoever runs it and shows the date, the to-do list and the free disk space, make it runnable, turn it into a command called morning, and let a check script run it from another folder to tell you what's done.

Source: https://www.ask-codey.com/courses/bash-in-depth/chapters/bash-your-first-script
