> For instance, awk --help reports 'BusyBox v1.31.1 (2020-12-18 22:25:41
> EST)' when called as either awk or /usr/bin/awk, whereas '/bin/echo
> --help' reports 'BusyBox v1.31.1 (2020-12-18 22:25:41 EST)' but without
> the path it simply echoes '--help'. So I'm curious where the separate
> executables come from. Are some simply links to the busybox versions,
> whereas others are standalone binaries?
Yeah, it can get confusing.
On pcp, a command can be provided by a) ash itself, b) a busybox builtin
(invoked either via a symlink from 'cmd' to busybox, or "busybox
'cmd'"), or c) from a separate executable entirely.
bash is friendlier than ash in that it provides a builtin command called
"type" which, if you invoke "type -a cmd" will tell you everywhere in
your shell, or along your PATH that 'cmd' can be found. Sadly, ash's
"type" command has no '-a' option, and will only tell you about the
first version of 'cmd' that's available, and will stop. So "type echo"
only prints "echo" (note the absence of slashes) and "type awk" only
prints "/usr/local/bin/awk". The good news is that "which -a" will find
everything in your PATH. So you if you use both commands, you get all
the information you need. Some might be duplicated. So:
Code:
--------------------
$
$ type echo; which -a echo
echo is a shell builtin
/bin/echo
$ ls -l /bin/echo
lrwxrwxrwx 1 root root 7 Jan 1 1970 /bin/echo -> busybox*
$
$ type awk; which -a awk
awk is /usr/local/bin/awk
/usr/local/bin/awk
/usr/bin/awk
$
$ ls -l /usr/local/bin/awk /usr/bin/awk
lrwxrwxrwx 1 root root 17 Jan 1 1970 /usr/bin/awk ->
../../bin/busybox*
lrwxrwxrwx 1 root root 34 Jan 1 1970 /usr/local/bin/awk
-> /tmp/tcloop/gawk/usr/local/bin/awk*
--------------------
There are two versions of echo on the system. I'd be surprised if they
behave differently -- since they're both provided by busybox.
There are also two versions of awk, but in this case one is provided by
busybox, and the other by an extension. I suspect the built-in version
is more primitive than the external one.
So I suspect udev is invoked with a different PATH than you're using.
Most likely it doesn't include /usr/local/bin -- if I were writing
critical system code, I wouldn't rely on /usr/local/bin either.
paul
------------------------------------------------------------------------
pgf's Profile: http://forums.slimdevices.com/member.php?userid=58510
View this thread: http://forums.slimdevices.com/showthread.php?t=113661
_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix