The traces you provide show that what's happening is actually that the
*, being expanded in a directory with no files, expands to the literal
'*', which is somewhat awkward with which to deal but which is
mandated by POSIX for /bin/sh:

>From 
>http://www.opengroup.org/onlinepubs/000095399/utilities/xcu_chap02.html#tag_02_13,
retrieved on 2009-05-10:
| If the pattern contains an invalid bracket expression or does not
| match any existing filenames or pathnames, the pattern string shall
| be left unchanged.

So why are all these other filenames appearing in the trace?  Simple:
because you don't use the correct double-quoting around your use of
$f, and so

  [ -w /sys/module/speakup/parameters/$f ]

gets expanded to

  [ -w /sys/module/speakup/parameters/* ]

and then the * gets expanded in that context.  Note that this probably
means that the script is already broken in the case of filenames in
the starting directory that contain whitespace or pattern-matching
metacharacters.

   ---> Drake Wilson



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to