Man page - subst(1)
Packages contas this manual
- subst(1)
- ctlinnd(8)
- makeactive(8)
- hosts.nntp(5)
- shlock(1)
- convdate(1)
- overview.fmt(5)
- pgpverify(8)
- innwatch.ctl(5)
- installit(1)
- news-recovery(8)
- shrinkfile(1)
- innwatch(8)
- history(5)
- batcher(8)
- buffchan(8)
- clientlib(3)
- fastrm(8)
- nntpsend(8)
- innstat(8)
- newslog(8)
- filechan(8)
- grephistory(1)
- expirerm(8)
- scanlogs(8)
- innd(8)
- distrib.pats(5)
- expire(8)
- libinn(3)
- innxmit(8)
- inndcomm(3)
- control.ctl(5)
- expireover(8)
- active(5)
- tally.unwanted(8)
- cvtbatch(8)
- makehistory(8)
- overchan(8)
- news.daily(8)
- newsfeeds(5)
- rnews(1)
- innconfval(1)
- newslog(5)
- newsrequeue(8)
- getlist(1)
- moderators(5)
- send-uucp(8)
- in.nnrpd(8)
- prunehistory(8)
- nntpget(1)
- crosspost(8)
- parsedate(3)
- expire.ctl(5)
- nnrp.access(5)
- inncheck(8)
- inndstart(8)
- nntpsend.ctl(5)
- inews(1)
- dbz(3)
- innxbatch(8)
- qio(3)
- tally.control(8)
- inn.conf(5)
- actsync(8)
- innlog.pl(8)
- archive(8)
- writelog(8)
- wildmat(3)
- passwd.nntp(5)
apt-get install inn
Available languages:
en zh_TW zh_CNManual
| SUBST(1) | General Commands Manual | SUBST(1) |
NAME
subst - 替換檔案中的定義
總覽 (SYNOPSIS)
subst [ -e editor ] -f substitutions victim ...
描述 (DESCRIPTION)
Subst 能夠 替換 檔案 的 內容, 適用於 針對 本地情況 定製 軟體. 它 根據 substitutions 的 內容, 修改 每一個 victim 檔案.
在 substitutions 檔案 中, 每個 替換說明(substitution) 佔用 一行. 每一行 包含 兩個域, 用 一個或多個 tab 符 隔開. 第一個 域 是 替換說明 的 名字(name), 第二個 域 是 它的 值(value). 兩者 均不應該 包含 ``#'' 字元; 而使用 文字編輯器 的 轉義符, 如 ``&'' 和 ``\'', 也是 不明智地; 名字 最好 限制在 字母和數字 中; 以 ``#' 開始 的 行 是 註釋, 將被 忽略.
在 victim 檔案 中, 每一個 需要 替換 的 行 (目標行) 必須 跟在 原形行(prototype line) 後面. 原形行 應該 有 這樣 的 限制: 將來 其他 程式 處理 這個檔案 的 時候, 它 被視為 註釋. 原形行 必須 包含 目標行 的 "原形", 該 "原形" 用 ``=()<'' 和 ``>()='' 括起來, 這一行 的 其他內容 都被 忽略掉. Subst 將 分析 這個原形, 尋找 替換說明 中 名字域 的 所有 例項, 名字例項 是用 ``@<'' 和 ``>@'' 括起來的, 把 它們 改變成 對應的值, 然後 用這個 結果 替換 目標行.
選項 (OPTIONS)
- -e
- 替換 操作 由 sed(1) 編輯器 完成, 它 必須 放在 /bin 或 /usr/bin 目錄 下面. 用 ``-e'' 開關 可以 指定 一個 不同位置 的 執行程式.
示例 (EXAMPLE)
如果 substitutions 檔案內容 是
FIRST 111 SECOND 222
而 victim 檔案 是
x = 2; /* =()<y = @<FIRST>@ + @<SECOND>@;>()= */ y = 88 + 99; z = 5;
那麼 ``subst -f substitutions victim'' 命令 把 victim 改變成:
x = 2; /* =()<y = @<FIRST>@ + @<SECOND>@;>()= */ y = 111 + 222; z = 5;
檔案 (FILES)
victimdir/substtmp.new 建立出來的新版本檔案
victimdir/substtmp.old 經過改名的老版本檔案
另見 (SEE ALSO)
sed(1)
診斷 (DIAGNOSTICS)
如果 subst 無法 建立 臨時檔案, 或者 臨時檔案 已經 存在, 程式 中止 並 報錯.
歷史 (HISTORY)
Henry Spencer 寫於 U of Toronto.
Rich $alz 在 1991 年 7 月 增加了 ``-e'' 選項.
BUGS
當 建立 準備 用 subst 處理的 檔案 時, 很容易 忘記 在 原形行 後面 插入 一個 要命的 目標行; 如果 你 忘了 目標行, subst 最終 會 刪掉 原形行 下面一行, 不管 那行 是 什麼.
[中文版維護人]
徐明 <xuming@users.sourceforge.net>
[中文版最新更新]
2004/02/28
《中國Linux論壇man手冊頁翻譯計劃》
http://cmpp.linuxforum.net
跋
本頁面中文版由中文
man 手冊頁計劃提供。
中文 man
手冊頁計劃:https://github.com/man-pages-zh/manpages-zh
| local | 25 Feb 1990 |