O'Reilly logo

Linux and Unix Shell Programming by David Tansley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

14.4. Positional variable parameters

At the beginning of this chapter, I said that there were four types of variables, local and environment, plus two other types considered special because they are readonly. These are positional and special variable parameters. Let’s look at the positional variables.

When you want to pass information to a shell script, you can access this information using positional parameters. A number references each parameter passed to a script. You can pass as many arguments as you like but you can only access the first nine parameters, though you can get around this limitation using the command shift. We will see shift in action later on in the book. The parameters start at one and finish at nine; each parameter you wish ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required