Click to See Complete Forum and Search --> : man pages (and getopts)


Strogian
02-02-2002, 09:48 PM
Anyone here ever just start reading man pages just for the hell of it? I did that for a few hours today. It's pretty cool, really. :) (just went in /bin and /etc and started bringing up the man pages for stuff there..) I think I got confused somewhere though.. lemme think.. Ah yes. The getopts command. Anyone know what that's all about?

Speedy
02-02-2002, 10:33 PM
getopts is a perl function for parsing the options or arguments to a perl program. Or thats the sense that I get. I could be wrong, I don't program in perl (or much at all really).

-Speedy

Strogian
02-02-2002, 11:02 PM
Hmm.. That's probably true (since that's pretty much all I could find using Google :)), but the getopts I'm talking about is a builtin bash command. 'man :' will bring it up for ya, about 1/3 of the way down.

DMR
02-03-2002, 03:37 AM
Do you mean this one (http://www.ss64.demon.co.uk/bash/getopts.html)?

:)

Strogian
02-03-2002, 10:43 AM
Originally posted by DMR:
<STRONG>Do you mean this one (http://www.ss64.demon.co.uk/bash/getopts.html)?

:)</STRONG>

Yep. That is exactly what the man page says. I do understand it a little more now, though. It looks like it is for getting options passed through the shell (through the exec command, I guess?). I'm not exactly sure how the options need to look to be caught, but now at least I have enough knowledge to test it! :)