Go ProSign in

This Lesson is for Members

Subscribe today and get access to all lessons! Plus direct HD download for offline use, enhances transcripts, member comment forums, and iTunes "podcast" RSS feed. Level up your skills now!

Unlock This Lesson

Already subscribed? Sign In

Automate Daily Development Tasks with Bash

Automate Daily Development Tasks with Bash

Autoplay

    Create and Run Bash Scripts with Command Line Arguments

    Cameron NokesCameron Nokes
    5:41

    In the lesson, we’ll learn how to encapsulate some logic we want to easily run later in a script. After creating the script, we have to use chmod u+x to give it execute permissions. If we want our script to make use of parameters passed to it when it's invoked, we can reference them using the syntax $1, $2, etc. (also known as positional parameters).

    We’ll also learn about what $PATH is, and move our script to a folder already on the $PATH so that it can be executed in any folder in our shell.

    You must be a Member to view code