Command line arguments

Command line

Command line arguments

positional parameters

arguments passed to the script from the command line: $0, $1, $2, $3 . . .

$0 is the name of the script itself, $1 is the first argument, $2 the second, $3 the third, and so forth. After $9, the arguments must be enclosed in brackets, for example:

${10}, ${11}, ${12}.
# /home/user/myscript.sh arg1 arg2 arg3 ... arg10

$0 = myscript.sh
$1 = arg1
$2 = arg2
$3 = arg3
${10} = arg10

Browse Space

- Pages
- News
- Labels
- Attachments
- Bookmarks
- Mail
- Advanced

Explore Confluence

- Popular Labels
- Notation Guide

Your Account

Log In

 

Other Features

Add Content

- Add Comment