On my Android emulator, the /system/bin folder contains several symlinks that point to the toolbox binary:
# ls -l /system/bin
ls -l /system/bin
[SNIP]
lrwxr-xr-x root shell 2012-08-23 07:01 ls -> toolbox
lrwxr-xr-x root shell 2012-08-23 07:01 lsmod -> toolbox
lrwxr-xr-x root shell 2012-08-23 07:01 lsof -> toolbox
[SNIP]
-rwxr-xr-x root shell 181002 2012-08-23 07:01 toolbox
[SNIP]
#
My understanding is that 'toolbox' is a binary that is able to do everything that ls, lsmod, lsof etc... can do, and that calling 'ls -l' ends up calling 'toolbox ls -l'.
But what I don't understand is how this works: if 'ls' is indeed a symlink to 'toolbox', then 'ls -l' would become 'toolbox -l', which of course doesn't work.
What am I missing ? (or said differently: what makes 'ls -l' become 'toolbox ls -l' ?)
mylink para1
, then $0 would be equal to "myscript". Of course, it doesn't work that way at all: $0 is equals to "mylink", so the script can indeed know what the context is. Thanks a lot ! – laurent kubaski Nov 19 '12 at 15:32