February 2019
Beginner
504 pages
10h 47m
English

One feature that has been missing from our programs so far is the ability to accept and process command line options and arguments. In this chapter, we will examine the shell features that allow our programs to get access to the contents of the command line.
The shell provides a set of variables called positional parameters that contain the individual words on the command line. The variables are named 0 through 9. They can be demonstrated this way:
#!/bin/bash# posit-param: script to view command line parametersecho "\$0 = $0\$1 = $1\$2 = $2\$3 = $3\$4 = $4\$5 = $5\$6 = $6\$7 = $7\$8 = $8\$9 = ...
Read now
Unlock full access