Positional Parameters

Positional Parameters - Positional Parameters Creating...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Positional Parameters Creating Scripts that Accept Arguments Scripts can be made even for dynamic when we write them with the ability to accept arguments from the command line. The position of the argument(s) on the command line are significant and as such they are known as positional parameters or arguments. Inside the script these arguments are formulated using a % sign followed by a digit from 0 through 9, where: %0 is the name of the command itself. %1 is the first argument of the command. %2 is the second argument of the command %9 is the ninth argument of the command. Example 1: testPosParmInput.cmd In the example above testPosParmInput.cmd is a script that accepts parameters ( or arguments ) from the command line. Here is the output when run from the command line with the following 4 positional parameters: 345 DeVry Apple IBM Exercises: Copy and execute testPosParmInput.cmd on your H: drive.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/21/2010 for the course NETW net230 taught by Professor Dae during the Spring '10 term at DeVry NY.

Page1 / 3

Positional Parameters - Positional Parameters Creating...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online