Title: Running a Script
Course: CIS 121: Linux/UNIX I: Fundamentals ~ For IGNITE Review > Section: Learning Modules

Running a Script

If a script is in your pwd, just put a "./" in front of the script name. This tells the shell where to find it, such as: ./my_scl.

Note: There is NO SPACE between the "./" and the name of the script.

Passing Information to a Script

You can name locations in memory that will hold specific information for you. These are called variables. When running a script, you can add arguments to the command line. The data from the command line can be accessed by using a dollar sign ($) and the number of the argument. These special variables are called "passed parameters" or "command line arguments". These special variables only exist while your script is running.

Example script with a passed parameter: