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

📄 make-08.html

📁 unix make 文档
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -60.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 78.0pt">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
函数功能:去掉字串(若干单词,使用若干空字符分割)“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">STRINT</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”开头和结尾的空字符,并将其中多个连续空字符合并为一个空字符。</span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -60.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 78.0pt">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
返回值:无前导和结尾空字符、使用单一空格分割的多单词字符串。</span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -60.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 78.0pt">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
函数说明:空字符包括空格、</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">[Tab]</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">等不可显示字符。</span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -60.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 78.0pt">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
示例:</span></p>
<p class="MsoNormal" style="margin-left:58.2pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">STR =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
a&nbsp;&nbsp;&nbsp; b c&nbsp;&nbsp;&nbsp;&nbsp; </span></i></b></p>
<p class="MsoNormal" style="margin-left:58.2pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">LOSTR = $(strip 
$(STR))</span></i></b></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: 24.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
结果是“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">a 
b c</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”。</span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: 24.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">strip</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”函数经常用在条件判断语句的表达式中,确保表达式比较的可靠和健壮!</span></p>
<h3><a name="_gnu_make_8.2.4"><b><span lang="EN-US" style="color: blue">8.2.4<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>$(findstring FIND,IN)</span></b></a></h3>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -60.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 78.0pt">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
函数名称:查找字符串函数—</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">findstring</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">。</span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -60.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 78.0pt">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
函数功能:搜索字串“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">IN</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”,查找“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">FIND</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”字串。</span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -60.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 78.0pt">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
返回值:如果在“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">IN</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”之中存在“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">FIND</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”,则返回“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">FIND</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”,否则返回空。</span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -60.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 78.0pt">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
函数说明:字串“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">IN</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”之中可以包含空格、</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">[Tab]</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">。搜索需要是严格的文本匹配。</span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -60.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 78.0pt">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
示例:</span></p>
<p class="MsoNormal" style="margin-left:58.2pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">$(findstring 
a,a b c)</span></i></b></p>
<p class="MsoNormal" style="margin-left:58.2pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">$(findstring 
a,b c)</span></i></b></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: 24.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
第一个函数结果是字“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">a</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”;第二个值为空字符。</span></p>
<h3><a name="_gnu_make_8.2.5"><b><span lang="EN-US" style="color: blue">8.2.5<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>$(filter PATTERN…,TEXT)</span></b></a></h3>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -60.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 78.0pt">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
函数名称:过滤函数—</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">filter</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">。</span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -60.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 78.0pt">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
函数功能:过滤掉字串“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">TEXT</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”中所有不符合模式“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">PATTERN</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”的单词,保留所有符合此模式的单词。可以使用多个模式。模式中一般需要包含模式字符“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">%</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”。存在多个模式时,模式表达式之间使用空格分割。</span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -60.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 78.0pt">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
返回值:空格分割的“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">TEXT</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”字串中所有符合模式“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">PATTERN</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”的字串。</span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -60.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 78.0pt">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
函数说明:“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">filter</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”函数可以用来去除一个变量中的某些字符串,我们下边的例子中就是用到了此函数。</span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -60.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 78.0pt">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
示例:</span></p>
<p class="MsoNormal" style="margin-left:58.2pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">sources := 
foo.c bar.c baz.s ugh.h</span></i></b></p>
<p class="MsoNormal" style="margin-left:58.2pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">foo: $(sources)</span></i></b></p>
<p class="MsoNormal" style="margin-left:58.2pt;text-indent:13.8pt"><b><i>
<span lang="EN-US" style="font-size: 12.0pt; font-family: Arial">cc $(filter %.c 
%.s,$(sources)) -o foo</span></i></b></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: 24.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other">
<span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">
&nbsp;</span></p>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; line-height: 150%; text-autospace: ideograph-numeric ideograph-other">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
使用“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">$(filter 
%.c %.s,$(sources))</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”的返回值给</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">cc</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">来编译生成目标“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">foo</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”,函数返回值为“</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">foo.c 
bar.c baz.s</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">”。</span></p>
<h3><a name="_gnu_make_8.2.6"><b><span lang="EN-US" style="color: blue">8.2.6<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>$(filter-out PATTERN...,TEXT)</span></b></a></h3>
<p class="MsoNormal" style="text-align: justify; text-justify: inter-ideograph; text-indent: -60.0pt; line-height: 150%; text-autospace: ideograph-numeric ideograph-other; margin-left: 78.0pt">
<span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">
函数名称:反过滤函数—</span><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%; font-family: Arial; color: black">filter-out</span><span style="font-size: 12.0pt; line-height: 150%; font-family: 楷体_GB2312; color: black">。</span></p>

⌨️ 快捷键说明

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