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"}
However, i want to differentiate between files that originated from the first argument (a*) and the second (b*), how do i do that? What i am searching for is a method that can tell me by the example above that "aa" and "ab" came from the first argument and "ba" and "bb" from the second.
I know that the cp.c commands can do this, but i couldn't figure out how, as the source code is quite nested.
Edit: standard copy (from gnu core utils) cannot differentiate, only embedded (shells, where programm and utils are the same file) can.
And then search the delimiter from your program:
The output is: