Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Convention used by UNIX man pages

1 view
Skip to first unread message

Generic Usenet Account

unread,
Nov 19, 2009, 3:11:11 PM11/19/09
to
Apologies if this is OT!

I can almost swear that I had read somewhere that in UNIX online
documentation using man, the portion of the construct enclosed in ’[’
and ’]’ denotes an optional parameter while the portion of the
construct enclosed in ’<’ and ’>’ denotes a mandatory parameter.
Today I was challenged by a colleague that using ’<’ and '>' is not a
standard way of denoting mandatory parameters. According to my
colleague, mandatory parameters are just listed as is i.e. without any
delimiting angle brackets. Is this correct?

TIA
Zach

Lew Pitcher

unread,
Nov 19, 2009, 3:28:14 PM11/19/09
to
On November 19, 2009 15:11, in comp.unix.programmer, Generic Usenet Account
(use...@sta.samsung.com) wrote:

In my experience, the manual pages use a modified form of regular expression
to express parameters.

- plain text is used to indicate required values
italicized text is used to indicate required values that vary in text
underlined text is also used to indicate required values that vary

- Square brackets ([ ]) surround optional values
i.e.: passwd [name]

- Brace brackets ({ } ) surround required parameters that have alternate
values, with the Vertical Bar ( | ) separating each alternate value
i.e.: passwd {-l|-u|-d|-S|-e} login

- ellipsis ( ... ) is used to indicate values that repeat
i.e.: cdc -r SID [-m[mrlist] ] [ -y[comment] ] file ...

I /have/ seen textual variants (mostly in emails and usenet postings) that
surround some text with angle brackets (< >) to indicate the same sort of
thing that italics and underlines indicates in printed manual pages

--
Lew Pitcher
Master Codewright & JOAT-in-training | Registered Linux User #112576
Me: http://pitcher.digitalfreehold.ca/ | Just Linux: http://justlinux.ca/
---------- Slackware - Because I know what I'm doing. ------


Chris Friesen

unread,
Nov 20, 2009, 1:31:31 AM11/20/09
to
On 11/19/2009 02:11 PM, Generic Usenet Account wrote:
> Apologies if this is OT!
>
> I can almost swear that I had read somewhere that in UNIX online
> documentation using man, the portion of the construct enclosed in �[�
> and �]� denotes an optional parameter while the portion of the
> construct enclosed in �<� and �>� denotes a mandatory parameter.

I generally agree with Lew's reply, but I was under the impression that
curly brackets "{}" are used in conjuction with a vertical bar to
indicate cases where exactly one of the specified options may be used.
This may indicate alternate forms of the same thing. For instance, here
is the start of the usage string for "cpio":

cpio {-o|--create} [-0acvABLV]

In this case you must choose either -o or --create, as they mean the
same. Then you can choose zero or more of "0acvABLV".

Chris

0 new messages