Re: daemon-less kmod & Alpha no-go!

Aaron M. Ucko (amu@MIT.EDU)
21 Apr 1998 02:27:42 -0400


"Steven N. Hirsch" <shirsch@ibm.net> writes:

> The success of modprobe under the shell script started me thinking. I
> renamed /sbin/modprobe to /sbin/modprobe.real and created a stub
> /sbin/modprobe like this:
>
> #!/bin/sh
> shift
> /sbin/modprobe.real $*

Ignoring for the moment the $*/"$@" issue (even though it's one of my
pet peeves), this script has two effects: it throws away the first
argument to modprobe (why?) and it runs it as a child of an sh
process. Have you determined which of those makes the difference?
(To test just the first, exec modprobe.real; to test just the second,
remove the shift.)

(Back to peeve:) As a general rule, you want "$@" instead of $* in sh
scripts; $* goes through things like globbing and word splitting,
which you don't want when you're passing all your arguments to
something else.

(Essentially, "$@" is equivalent to
"$1" "$2" ...
and $* is equivalent to
$1 $2 ...)

-- 
Aaron M. Ucko, KB1CJC <amu@mit.edu> (finger amu@monk.mit.edu)

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu