lkml.org 
[lkml]   [1998]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: daemon-less kmod & Alpha no-go!
From(Aaron M. Ucko)
Date21 Apr 1998 11:25:14 -0400
"Steven N. Hirsch" <shirsch@ibm.net> writes:

> > 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?)
>
> Why? Because the first argument is "/sbin/modprobe", the name of the
> little script itself. Recursive death results if we try to call
> ourselves.

That's really the "zeroth argument", which is NOT included in $* or
"$@". Allow me to demonstrate:

#amu(amu)@tux:~
; cat > /var/tmp/amu/argtest.sh
echo "$0"
echo "$@"
#amu(amu)@tux:~
; ln -s argtest.sh /var/tmp/amu/foo
create symbolic link /var/tmp/amu/foo to argtest.sh
#amu(amu)@tux:~
; chmod +x /var/tmp/amu/argtest.sh
#amu(amu)@tux:~
; /var/tmp/amu/argtest.sh blah blah blah
/var/tmp/amu/argtest.sh
blah blah blah
#amu(amu)@tux:~
; /var/tmp/amu/foo blah blah blah
/var/tmp/amu/foo
blah blah blah
#amu(amu)@tux:~
; sh /var/tmp/amu/argtest.sh blah blah blah
/var/tmp/amu/argtest.sh
blah blah blah

> > 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
>
> Which will accomplish nothing, as we have discarded the arguments to
> modprobe.real.

...with the arguments we got, of course.

--
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

\
 
 \ /
  Last update: 2005-03-22 13:42    [from the cache]
©2003-2010