while writing your own Bash shell command
Hi;
I have to write a couple of user defined Bash shell commands but I do not know how I will make these commands have some options(like -o,-l etc.) or have some input or output files as arguments.Thanks.. |
Are you writing them as shell scripts? Or functions? In either case, all arguments are available in $*, you just need to parse them. Or, if you're concerned with position, you could use $1..$n for "n" arguments.
|
I 'm supposed to write them as shell scripts but from the tutorials I have read so far ,I could not learn how a command recognizes a given valid(or gives an error if it is unvalid) option or uses a given file as an argument.:(
|
Checked your tuts for "getopts"?
|
|
All times are GMT -5. The time now is 10:17 PM. |