4 ms·
It's a carryover from the MS-DOS days. One unfortunate part is that each program has to implement globs and any similar feature itself.
by FreeFull 6y ago
It's a carryover from the MS-DOS days. One unfortunate part is that each program has to implement globs and any similar feature itself.
- frutiger 6y agoEven in a modern Unix, globs are expanded by the shell before invoking exec(3) with the individual arguments split out. They are not split/expanded by the C runtime.
- userbinator 6y ago...and I'm pretty sure DOS inherited it from CP/M.
- Someone 6y ago‘Implement’ isn’t necessary. That code could be provided by a shared library. That could be the superior option. Moving command line expansion into a shared library gets rid of the problem where the command line with globs expanded is too long, could have standardized option handling earlier (that system-provided library for globbing could easily grow to handle option flags), could better handle file names containing spaces, etc.