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

📄 tt12

📁 unix v7是最后一个广泛发布的研究型UNIX版本
💻
字号:
.NHConditionals.PPSuppose we want the.BD .SHmacro to leave two extra inches of space just before section 1,but nowhere else.The cleanest way to do that is to test inside the.BD .SHmacrowhetherthe section number is 1,and add some space if it is.The.BD .ifcommand provides the conditional testthat we can addjust before the heading line is output:.P1 4^if \e\en(SH=1 ^sp 2i	\e" first section only.P2.PPThe condition after the.BD .ifcan be any arithmetic or logical expression.If the condition is logically true, or arithmetically greater than zero,the rest of the line is treated as ifit were text _here a command.If the condition is false, or zero or negative,the rest of the line is skipped..PPIt is possible to do more than one command if a condition is true.Suppose several operations are to be done before section 1.One possibility is to define a macro .BD .S1and invoke itif we are about to do section 1(as determined by an.BD .if )..P1^de S1---  processing for section 1 ---^^^de SH^^^^if \e\en(SH=1 ^S1^^^^^.P2.PPAn alternate way is to use theextended form of the.BD .if ,like this:.P1^if \e\en(SH=1 \e{--- processingfor section 1 ----\e}.P2The braces.BD \e{and.BD \e}must occur in the positions shownor you will get unexpected extra lines in your output..UL troffalso providesan `if-else' construction,which we will not go into here..PPA condition can be negated by preceding it with.BD ! ;we get the same effect as above (but less clearly) by using.P1^if !\e\en(SH>1 ^S1.P2.PPThere are a handful of other conditions that can be tested with.BD .if .For example, is the current page even or odd?.P1^if e ^tl ''even page title''^if o ^tl ''odd page title''.P2gives facing pages different titleswhen used inside an appropriate new page macro..PPTwo other conditionsare.BD tand.BD n ,which tell you whether the formatter is.UL troffor.UL nroff . .P1^if t troff stuff ...^if n nroff stuff ....P2.PPFinally, string comparisons may be made in an.BD .if :.P1^if  'string1'string2'  stuff.P2does `stuff' if.ulstring1is the same as.ulstring2.The character separating the strings can be anythingreasonable that isnot contained in either string.The strings themselves can reference strings with.BD \e* ,arguments with .BD \e$ ,and so on.

⌨️ 快捷键说明

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