Re:A common mistake involving wildcards and the find command
by tzs on Sunday February 09, 2020 @02:11AM
(#22280835)
> What would be a concrete proposal for this X-Y mapping, taking into account that a single Y results in multiple Xes?
Two arrays:
1. An array of all the Ys.
2. An array with one entry for each X. If X came from shell wildcard expansion, this entry is the index into the first array of the Y whose expansion resulted in X. If X did not come from wildcard expansion, this entry is some magic value that cannot be mistaken for an index into the first array.
Pass these arrays in the environment. No need for any kernel or standard library or language runtime modification to support it.
Two arrays:
1. An array of all the Ys.
2. An array with one entry for each X. If X came from shell wildcard expansion, this entry is the index into the first array of the Y whose expansion resulted in X. If X did not come from wildcard expansion, this entry is some magic value that cannot be mistaken for an index into the first array.
Pass these arrays in the environment. No need for any kernel or standard library or language runtime modification to support it.