精华内容
下载资源
问答
  • wildcard

    2012-12-04 11:05:00
    1、wildcard : 扩展通配符2、notdir : 去除路径3、patsubst :替换通配符例子:建立一个测试目录,在测试目录下建立一个名为sub的子目录$ mkdir test$ cd test$ mkdir sub在test下,建立a.c和b.c2个文件,在sub目录...

    1、wildcard : 扩展通配符
    2、notdir : 去除路径
    3、patsubst :替换通配符

    例子:
    建立一个测试目录,在测试目录下建立一个名为sub的子目录
    $ mkdir test
    $ cd test
    $ mkdir sub

    在test下,建立a.c和b.c2个文件,在sub目录下,建立sa.c和sb.c2 个文件

    建立一个简单的Makefile
    src=$(wildcard *.c ./sub/*.c)
    dir=$(notdir $(src))
    obj=$(patsubst %.c,%.o,$(dir) )

    all:
    @echo $(src)
    @echo $(dir)
    @echo $(obj)
    @echo "end"

    执行结果分析:
    第一行输出:
    a.c b.c ./sub/sa.c ./sub/sb.c

    wildcard把 指定目录 ./ 和 ./sub/ 下的所有后缀是c的文件全部展开。

    第二行输出:
    a.c b.c sa.c sb.c
    notdir把展开的文件去除掉路径信息

    第三行输出:
    a.o b.o sa.o sb.o

    在$(patsubst %.c,%.o,$(dir) )中,patsubst把$(dir)中的变量符合后缀是.c的全部替换成.o,
    任何输出。
    或者可以使用
    obj=$(dir:%.c=%.o)
    效果也是一样的。

    这里用到makefile里的替换引用规则,即用您指定的变量替换另一个变量。
    它的标准格式是
    $(var:a=b) 或 ${var:a=b}
    它的含义是把变量var中的每一个值结尾用b替换掉a

    今天在研究makefile时在网上看到一篇文章,介绍了使用函数wildcard得到指定目录下所有的C语言源程序文件名的方法,这下好了,不用手工一个一个指定需要编译的.c文件了,方法如下:

    SRC = $(wildcard *.c)

    等于指定编译当前目录下所有.c文件,如果还有子目录,比如子目录为inc,则再增加一个wildcard函数,象这样:

    SRC = $(wildcard *.c) $(wildcard inc/*.c)

    转载于:https://www.cnblogs.com/rayfloyd/archive/2012/12/04/2800995.html

    展开全文
  • Wildcard

    千次阅读 2011-12-13 12:17:59
    首先, wildcard 也是屬於 command line 的處理工序, 作用於 argument 裡的 path 之上. 沒錯, 它不用在 command_name 也不用在 options 上. 而且, 若 argument 不是 path 的話, 那也與 wildcard 無關. 換句更為精...
    首先, wildcard 也是屬於 command line 的處理工序, 作用於 argument 裡的 path 之上.
    沒錯, 它不用在 command_name 也不用在 options 上.
    而且, 若 argument 不是 path 的話, 那也與 wildcard 無關.
    換句更為精確的定義來講, wildcard 是一種命令行的路逕擴展(path expansion)功能.
    提到這個擴展, 那就不要忘記了 command line 的"重組"特性了!
    是的, 這與變量替換(variable substitution)及命令替換(command substitution)的重組特性是一樣的!
    也就是在 wildcard 進行擴展後, 命令行會先完成重組才會交給 shell 來處理.

    了解了 wildcard 的擴展與重組特性後, 接下來, 讓我們了解一些常見的 wildcard 吧:
    *: 匹配 0 或多個字元
    ?: 匹配任意單一字元
    [list]: 匹配 list 中的任意單一字元(註一)
    [!list]: 匹配不在 list 中的任意單一字元
    {string1,string2,...}: 匹配 sring1 或 string2 (或更多)其一字串

    (註一: list 可以為指定的個別字元, 如 abcd; 也可以為一段 ASCII 字元的起止範圍, 如: a-d .)

    例:
    a*b: a 與 b 之間可以有任意長度的任意字元, 也可以一個也沒有, 如: aabcb, axyzb, a012b, ab 等.
    a?b: a 與 b 之間必須也只能有一個字元, 可以是任意字元, 如: aab, abb, acb, a0b 等.
    a[xyz]b: a 與 b 之間必須也只能有一個字元, 但只能是 x 或 y 或 z, 如: axb, ayb, azb 這三個.
    a[!0-9]b: a 與 b 之間必須也只能有一個字元, 但不能是阿拉伯數字, 如: axb, aab, a-b 等.
    a{abc,xyz,123}b: a 與 b 之間只能是 abc 或 xyz 或 123 這三個字串之一, 如 aabcb, axyzb, a123b 這三個.


    注意:
    1) [! ] 中的 ! 只有放在第一順位時, 才有排除之功. 舉例說:
    [!a]* 表示當前目錄下所有不以 a 開首的路逕名稱.
    /tmp/[a\!]* 表示 /tmp 目錄下以 a 或 ! 開首的路逕名稱. (思考: 為何 ! 前面要加 \ 呢? 提示: 十三問之 4 )

    2) [ -] 中的 - 左右兩邊均有字元時, 才表示一段範圍, 否則僅作 "-"(減號) 字元來處理. 舉例說:
    /tmp/*[-z]/[a-zA-Z]* 表示 /tmp 目錄下所有以 z 或 - 結尾的子目錄下以英文字母(不分大小寫)開首的路逕名稱.

    3) 以 * 或 ? 開首的 wildcard 不能匹配隱藏文件(即以 . 開首的文件). 舉例說:
    *.txt 並不能匹配 .txt 但可匹配 1.txt 這樣的路逕名稱.
    但 1*txt 及 1?txt 均可匹配 1.txt 這樣的路逕名稱.

    基本上, 要掌握 wildcard 並不難, 只要多加練習, 再勤於思考, 就能熟加運用了.
    再次提醒: 別忘了"擴充+重組"這個重要特性, 而且只作用在 argument 的 path 上.
    比方說, 假設當前目錄下有 a.txt b.txt c.txt 1.txt 2.txt 3.txt 這幾份文件.
    當我們在命令行中下達 ls -l [0-9].txt 的命令行時,
    因為 wildcard 處於 argument 的位置上, 於是根據其匹配的路逕, 擴展為 1.txt 2.txt 3.txt ,
    再重組出 ls -l 1.txt 2.txt 3.txt 這樣的命令行.
    因此, 你在命令行上敲 ls -l [0-9].txt 與 ls -l 1.txt 2.txt 3.txt 都是同樣的結果, 其原因正是於此了... :)


    (順道一提: eval )

    講到 command line 的重組特性, 真的需要我們好好的加以理解的.
    如此便能抽絲剝襺的一層層的將整個 command line 分析得一清二楚, 而不至於含糊.
    假如這個重組特性理解下來, 那麼, 接下來我們介紹一個好玩的命令 --- eval .

    我們在不少變量替換的過程中, 常碰到所謂的複式變量的問題, 如:


    a=1
    A1=abc

    我們都知道 echo $A1 就可得到 abc 這個結果.
    然而, 我們能否用 $A$a 來取代 $A1 而同樣替換出 abc 呢?

    這個問題我們可用很輕鬆的用 eval  來解決:

    eval echo \$A$a

    說穿了, eval 只不過是在命令行完成替換重組後, 再來一次替換重組罷了...
    展开全文
  • Wildcard

    2017-07-14 04:37:07
    Problem Description When specifying file names (or paths) in DOS, Microsoft Windows and Unix-like operating systems, the asterisk character (“*") substitutes for any zero or more characters, and the ...
  • Wildcard URIs

    2020-12-29 21:43:49
    <div><p>Wildcard URIs as described in the AP designate their wildcard'ed components by using "empty strings". This is confusing for many. A single wildcard <code>"*"</code> is what...
  • Wildcard topics

    2021-01-07 20:53:59
    <div><p>This PR revolves around giving the Reader capabilities to read from wildcard topics <p>There is a singleton routine called the topic scanner that gets triggered by the first reader that wants ...
  • Wildcard routing

    2020-12-26 10:38:15
    This will include all the segments of the path matched by the asterisk.</li><li>Adds additional checking for <code>wildcard</code> routes so that a change in route segments triggers a route change, ...
  • Wildcard Support

    2020-12-08 18:13:31
    <div><p>Can anybody tell me how I can use a wildcard with better-sqlite3? <p>In node-sqlite3 I can put the wildcard character (%) inside the parameter. In better-sqlite3 it seems like this is not ...
  • Wildcard names

    2020-12-02 00:09:55
    <div><p>If an origin has a wildcard certificate, the origin frame allows it to narrow scope. But if we accept #177, then there is the potential for the origin to lose any claim to wildcards without ...
  • Wildcard check

    2021-01-10 06:40:27
    <div><p>Added the ability to check Wildcard before bruteforcing</p><p>该提问来源于开源项目:OJ/gobuster</p></div>
  • Wildcard certificate

    2020-12-01 13:57:03
    <div><p>Hello ! Just one question support of wildcard certificate is it a feature envisaged?</p><p>该提问来源于开源项目:GoogleCloudPlatform/gke-managed-certs</p></div>
  • using wildcard

    2020-12-30 03:25:52
    <p>Adding files using wildcard <h3>Steps to recreate <ol><li>inlude js files using wildcard </li><li>add "/assets/*.js" </li></ol> <h3>Current behavior <pre><code> > Bundler & Minifier...
  • Wildcard Search

    2021-01-07 05:11:02
    <div><p>Is it possible to query partial words with a wildcard query, such as "he*" for "hello"?</p><p>该提问来源于开源项目:RediSearch/RediSearch</p></div>
  • wildcard regexp

    2021-01-10 12:25:58
    <div><p>hi, <strong>Is your feature request related to a problem?...can be possible use addRegexEntity in manager for create a wildcard?</p><p>该提问来源于开源项目:axa-group/nlp.js</p></div>
  • Wildcard routes

    2021-01-01 17:42:10
    <div><p>Hi, <p>Are wildcard routes supported? ie /post/* where * could be 1 to n params. <p>Great router!</p><p>该提问来源于开源项目:auraphp/Aura.Router</p></div>
  • Recursive wildcard

    2020-12-25 17:49:47
    <div><p>It seems that recursive wildcard isn't supported. <p>Example: <code>touch **</code></p> <p>Is there a way to enable it?</p><p>该提问来源于开源项目:rmyorston/busybox-w32</p></div>
  • Wildcard searches

    2020-12-09 03:21:06
    <div><p>Any chance of allowing wildcard searches? Currently i'm downloading the data from R7 and just searching for our specific brand. I think it would be awesome if I could just use your project...
  • Wildcard DNS

    2020-12-06 03:05:37
    <div><p>It would be smarter to query *.target.xyz at the beginning and then ask the user whether they want to continue anyway or skip the dictionary test if there was a find, because the wildcard will...
  • * wildcard

    2020-12-08 22:29:17
    When this is the case, the subscription does not trigger on that wildcard topic. However if I change the topic to non-wildcard (<code>item.quantity.incremented), it works. <p>A workaround is to ...
  • Wildcard certificates

    2020-12-08 19:46:29
    s wildcard certificate support. <p>This will remove the need for http port 80 availability as it uses txt dns record verification mode. It will be only available for syncloud.it domains as we control ...
  • Wildcard Matching

    2020-12-01 18:04:01
    <p>But I think it should be made clear or have a wildcard operator that only operates on numbers to allow the original version to work.</p><p>该提问来源于开源项目:nelmio/alice</p></div>
  • Simplify wildcard

    2020-12-30 08:25:07
    <div><p>Issue #157 highlighted a bug in the wildcard handling, and the code had a few <code>#ifdef</code>'s and comments regarding the abilities of different compilers. I believe this fix is not ...
  • Wildcard hostnames

    2020-11-22 12:41:53
    <div><p>I was wanted to run web server with wildcard subdomains: <pre><code>sh ws --hostname *.test.localhost </code></pre> <p>This will be very useful to test multi-tenant applications, when each ...
  • <div><p>Is there a way to wildcard the IncludeAssembliesForScan setting? <p>I have 3 other assemblies that start with the same string "WebsiteArea." and i have more i'm working on. ...
  • 23.33.55.11, tomorrow and I want, if possible to use wildcard at last series of numbers, like: 23.33.55.* or 23.33.55.% something like this. <h3>Environment description <p>BungeeCord - Spigot <h3>...
  • Item wildcard

    2020-12-09 11:49:00
    <p>I tried to implemant wildcard in my items.yml to define an item named "log" which matches with all logs. So here's the line in the file: log: '*_LOG' <p>but when I reload, I ...
  • Wildcard support

    2021-01-08 12:49:22
    <div><p>Right now I'd like it to work on domain and all of it'...<p>It would be cool if there were wildcard support where all subdomains were included by default by having a file: domain....
  • Wildcard properties

    2020-12-01 20:22:41
    wildcard properties" in order to identify paths in a graph (see https://stackoverflow.com/questions/30916040/sparql-is-there-any-path-between-two-nodes) <p>Such wildcards typically look like (<...
  • <p>Create an use wildcard for a site: <pre><code> - map: foo.domain.test to: /home/vagrant/domain wildcard: "yes" use_wildcard: "yes" </code></pre> <p>Create but do <em>not</em> ...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 9,454
精华内容 3,781
关键字:

wildcard