![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| parameters | jaay | Shell Programming and Scripting | 4 | 04-14-2008 01:10 AM |
| sed and parameters | scotty_123 | Shell Programming and Scripting | 7 | 03-26-2007 01:22 AM |
| Max NO of parameters | Shivdatta | Shell Programming and Scripting | 1 | 07-24-2006 05:11 AM |
| parameters | aekaramg20 | Shell Programming and Scripting | 6 | 07-10-2006 10:15 PM |
| tar parameters | kmar | UNIX for Advanced & Expert Users | 4 | 10-23-2001 12:03 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
I can test for one parameter but anything more then that and I get an Error.
I forgot I run this batch in a shell #!/bin/sh ------------------------------------------------------------------------- Write a batch program that accepts a keyword as a parameter and finds all the files containing that keyword. Display the lines found and the number of hits. Adjust the batch program to accept 1, 2 or 3 parameters. If 1 parameter exists, we may assume we are looking for the word supplied. If 2 parameters exist, we are looking for files having both keywords. (this is harder) If 3 parameters exist, test the second one for the values and or -v and search accordingly. These are the only values accepted as the second parameter when 3 parameters are present. Anyhelp would be greatly appreciated. Thank You James Last edited by james2006; 06-08-2006 at 06:49 AM. |
| Forum Sponsor | ||
|
|
|
|||
|
I am not asking for anyone to do this for me just some help with passing the parameters.
this is how I am testing them. if test $#=3 then Grep Command elif test $#=2 then Grep Command elif test $#=1 then Grep Command. else echo no parameter was inputted. Yes it is for homework But I have seen many input questions in a way to mask that it is their homework. I came right out and posted it without trying to hide the fact that it is for my homework. All I am doing is asking for direction nothing more. |