Guest_imported
New member
- Jan 1, 1970
- 0
i'm trying this script and have a few basic(stupid) questions.
well the script runs like this.
printfiles [[-s number][-n number2]] filename1 [filename2...]
where number2 is the number of lines to be displayed beginning at line number number1. if one is not present a value of one is assumbed. if number2 is not present, a value of 5 is assumed if neither are present then print lines 1 to 5.
this is where i get confused how do i test how many arguments are assumed and if they are present with the right options.
i'm thining if the user doesn't enter filename arguments or options or different options this will not work and will mess up. how do i test for this?
well the script runs like this.
printfiles [[-s number][-n number2]] filename1 [filename2...]
where number2 is the number of lines to be displayed beginning at line number number1. if one is not present a value of one is assumbed. if number2 is not present, a value of 5 is assumed if neither are present then print lines 1 to 5.
this is where i get confused how do i test how many arguments are assumed and if they are present with the right options.
i'm thining if the user doesn't enter filename arguments or options or different options this will not work and will mess up. how do i test for this?