Originally posted by Kartik Mahadevan:
When we use * as a command line argument , the operating system supplies
all the names in the current working directory as the program's arguments?
that depends on the operating system.
Microsoft DOS/Windows (command.com, cmd.exe) does not, as far as i know, but the programs thus invoked are expected to interpret wildcards thusly themselves.
Linux/Unix command-line shells (bash, tcsh, ksh, and so on) expand wildcards before launching the program in question, replacing them with their expansion when invoking the program. the programs need not do this task, then -- but then again, the
shells are replaceable, and there are several to choose from; so one could debate whether this is really an
operating system function. at least in theory, one could have a Unix-like OS without a command-line shell, although i will admit it would be difficult.
What is the concept behind it?
i'm unsure what you mean to ask by this. the reason for doing wildcard expansion ("globbing") at the command line is to make the command line easier for humans to use.