![]() |
|
|
|
|
|||||||
| 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 |
| how to? launch command with string of command line options | TinCanFury | Shell Programming and Scripting | 5 | 04-28-2008 03:06 PM |
| AWK - Line length validation | en7smb | Shell Programming and Scripting | 3 | 05-09-2007 08:04 AM |
| Please give your inputs !!!! | kpatel786 | Shell Programming and Scripting | 9 | 04-27-2007 07:59 AM |
| Vaildation of command line inputs | sendhilmani123 | Shell Programming and Scripting | 6 | 07-17-2006 05:08 AM |
| Inputs from a file | sendhil | Shell Programming and Scripting | 4 | 02-01-2006 02:48 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Command line inputs validation
Hi,
I have a script called read.sh that takes a file as input. Now I want to make that script take the file as input with a -f option preceding the filename. How can I do this validation. How can I find whether the given option is -f or not inside the script. Thanks in advance |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Use getopts
|
|
#3
|
|||
|
|||
|
one more is direct argument validation....
as , Code:
if [ $1 = "-f" ] then echo "yes" else echo "no" fi |
|||
| Google The UNIX and Linux Forums |