2008年10月3日 星期五

Man Page (快快樂樂當男人)

上次說要當個好男人,今天就來快快樂樂塞進去莉納斯小姐的裙子下吧(靠~~~好變態!!!)
話說好男人超重要今天就來寫一個
#man bejo
可以用的東西吧

首先這個男人是用groff排版語法寫的

先了解ㄧ下麗娜斯的男人分類法

  1. 使用者命令(User command)
  2. 系統程式(System call)
  3. 程式庫程序(Library function)
  4. 設備檔案(Device file)
  5. 檔案用途描述
  6. 遊戲說明
  7. 雜項(Miscellaneous)
  8. 系統管理工具(只有root才能使用)
  9. Linux核心程序
他最好有這些內涵

  • NAME - 程式的名稱和功能簡介
  • SYNOPSIS - 語法定義, 顯示所有的選項及參數
  • DESCRIPTION - 功能詳述
  • OPTIONS - 選項列表, 對每一個選項都有一個簡短的說明.
  • ENVIRONMENT - 使用哪些環境變數
  • FILES - 本程式會使用或修改到哪些檔案
  • AUTHORS - 作者簡介
  • HISTORY - 本程式的歷史沿革
  • BUG - 已知的程式錯誤、漏洞
  • COPYRIGHT - 版權宣告
  • AVAILABILITY - 可由那裡得到這支程式.
  • SEE ALSO - 和本程式有關的其它程式有哪些可再供參考
為了顯示出這樣的結果

BEJO(1)                                        BeJo                                       BEJO(1)

NAME
       foo -  online test

SYNOPSIS
       foo [-option 1] [-option 2 configuration ] wait to do ...

DESCRIPTION
       bejo

OPTIONS
       -f     list friends

       -g     list girl friend

       -m     list money but it is empty !!!

       -p a tour config
              list tour NOW!!!

FILES
       /home/bejo/life.conf
              It is bejo life file search han(1) for more details
       /home/bejo/nextlife.conf
              search god(1) for more something

ENVIROMENT
       Taiwan

DIAGNOSTICS
BUGS
       He is always 20 years old

AUTHOR
       BeJo ( made by his father and mother)

SEE ALSO
       life(1)

Linux                                Last change: 1980/11/27                              BEJO(1)


先vi一個檔叫
bejo.1

內容
.\" Process this file with
.\" groff -man -Tascii bejo.1
.\"
.TH BEJO 1 "Last change: 1980/11/27" Linux "BeJo"
.SH NAME
foo \-  online test
.SH SYNOPSIS
.B foo [-option 1] [-option 2
.I configuration
.B ]
.I wait to do
.B ...
.SH DESCRIPTION
.B bejo
.SH OPTIONS
.IP -f
list friends
.IP -g
list girl friend
.IP -m
list money but it is
.IR empty
!!!
.IP "-p a tour config"
list tour NOW!!!
.SH FILES
.I /home/bejo/life.conf
.RS
It is bejo life file
search
.BR han(1)
for more details
.RE
.I /home/bejo/nextlife.conf
.RS
search
.BR god(1)
for more something
.SH ENVIROMENT
.IP Taiwan
.SH DIAGNOSTICS
.SH BUGS
He is always 20 years old
.SH AUTHOR
BeJo ( made by his father and mother)
.SH "SEE ALSO"
.BR life(1)

---
先用
#man .bejo.1
測試

再gzip起來
gzip -c bejo.1 > bejo.1.gz

之後拷貝到 ( OS: Debian)
#cp bejo.1.gz /usr/share/man/man1/

就可以用
#man bejo

這樣我也是好男人了 >//////////< (羞


--
附註
  • .B Bold(粗)
  • .BI Bold alternating with italics(斜)
  • .BR Bold alternating with Roman
  • .I Italics
  • .IB Italics alternating with bold
  • .IR Italics alternating with Roman
  • .RB Roman alternating with bold
  • .RI Roman alternating with italics
  • .SM Small (scaled 9/10 of the regular size)
  • .SB Small bold (not small alternating with bold)

參考文件:
Linux Man Page Howto
http://www.schweikhardt.net/man_page_howto.html






沒有留言:

張貼留言