Command line arguments in Bash

Viewed 64826

I want to write a bash script which takes different arguments. It should be used like normal linux console programs:

my_bash_script -p 2 -l 5 -t 20

So the value 2 should be saved in a variable called pages and the parameter l should be saved in a variable called length and the value 20 should be saved in a variable time.

What is the best way to do this?

2 Answers
Related