⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subst.1

📁 早期freebsd实现
💻 1
字号:
.TH SUBST 1 local.DA 25 Feb 1990.SH NAMEsubst \- substitute definitions into file(s).SH SYNOPSIS.B subst[.B \-eeditor].B \-fsubstitutionsvictim ....SH DESCRIPTION.I Substmakes substitutions into files, in a way that is suitable for customizingsoftware to local conditions.Each.I victimfileis altered according to the contents ofthe.I substitutionsfile..PPThe.I substitutionsfile contains one line per substitution.A line consists of two fields separated by one or more tabs.The first field is the \fIname\fP of the substitution, the secondis the \fIvalue\fP.Neither should contain the character `#', and use of text-editormetacharacters like `&' and `\e' is also unwise;the name in particular is best restricted to be alphanumeric.A line starting with `#' is a comment and is ignored..PPIn the \fIvictim\fPs,each line on which a substitution is to be made(a \fItarget\fP line)must be preceded by a\fIprototype\fP line.The prototype line should be delimited in such a way that it will betaken as a comment by whatever program processes the file later.The prototype line must contain a ``prototype'' of the target line bracketedby `=()<' and `>()=';everything else on the prototype line is ignored..I Substextracts the prototype, changes all instances of substitution namesbracketed by `@<' and `>@' to their values,and then replaces the target line with the result..PPSubstitutions are done using the.IR sed (1)editor, which must be found in either the.I /binor.I /usr/bindirectories.To specify a different executable, use the ``\-e'' flag..SH EXAMPLE.PPIf the \fIsubstitutions\fP file is.PP.RS.nf.ta \w'SECOND'u+4nFIRST	111SECOND	222.fi.RE.PPand the \fIvictim\fP file is.PP.RS.nfx = 2;/* =()<y = @<FIRST>@ + @<SECOND>@;>()= */y = 88 + 99;z = 5;.fi.RE.PPthen ``\fBsubst \-f \fP\fIsubstitutions victim\fP'' changes \fIvictim\fP to:.PP.RS.nfx = 2;/* =()<y = @<FIRST>@ + @<SECOND>@;>()= */y = 111 + 222;z = 5;.fi.RE.SH FILES.ta \w'\fIvictimdir\fP/substtmp.old'u+4n\fIvictimdir\fP/substtmp.new	new version being built.br\fIvictimdir\fP/substtmp.old	old version during renaming.SH SEE ALSOsed(1).SH DIAGNOSTICSComplains and halts if it is unable to create its temporary filesor if they already exist..SH HISTORYWritten at U of Toronto by Henry Spencer..PPRich $alz added the ``\-e'' flag July, 1991..SH BUGSWhen creating a file to be \fIsubst\fPed, it's easy to forget to inserta dummy target line after a prototype line;if you forget, \fIsubst\fP ends up deleting whichever line did in factfollow the prototype line.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -