|
|
|
|
|
by BlanketLogic
3693 days ago
|
|
> How is the program like 'ls' going to see a variable that is an array when originally it was a string delimited with ':'? There are two things here: the command 'ls' that you type on your shell and the executable named 'ls' located in "/bin/ls" (or wherever) which can list directories.
Most shells, when encounter a command X (say, 'ls') they see their 'context' to see if 'X' is defined. If yes, they will execute it. If not, they will assume that the X is an executable and try to execute it.
That's what happening here. Perhaps the following silly script helps? #!/bin/ls
ls () {
echo "MYLS $*"
}
ls $*
HTH |
|