If i input paths with wildcards as command line parameters, like:
testprogramm a* b*
and the directory contains the following content:
aa ab ba bb
my argv string will contain:
{"testprogramm","aa","ab","ba","bb"}
但是,我想区分源自第一个参数(a*
)和第二个参数(b*
)的文件,我该如何做到这一点?我正在寻找的是一种方法,可以通过上面的例子告诉我"aa"
和"ab"
来自第一个参数,"ba"
和"bb"
来自第二个参数.
我知道cp.c
个命令可以做到这一点,但我不知道如何做到这一点,因为源代码非常嵌套.
编辑:标准副本(来自gnu core utils)不能区分,只有嵌入的(shells,其中Programm和utils是同一个文件)可以.