On Jan 28, 2008 4:01 PM, Michael Biebl <[EMAIL PROTECTED]> wrote:
> 2008/1/27, Victor Lowther <[EMAIL PROTECTED]>:
> > Rewrite module loading and unloading to make POSIX compliant, simplify
> > the logic a little, and modify 50modules hook to take change in
> > modreload into account.
>
> local UNL="$(echo $1 |tr -- - _)" RET=1
>
> Why did you prefer tr over sed? sed is in /bin, whereas tr is in
> /usr/bin, which is
> imho a slight advantage (and I guess more people are familiar with sed)
Mainly because tr does what we need here and is slightly shorter.
Both of them are POSIX required utilities.
That reminds me, the -- in that tr command paramater is a GNUism, and
I should remove it. Patch attached.
> local UNL="$(echo $1 | sed s/-/_/g)" RET=1
>
>
> Cheers,
> Michael
> --
> Why is it that all of the instruments seeking intelligent life in the
> universe are pointed away from Earth?
>
diff --git a/pm/functions b/pm/functions
index 6982352..e129aa9 100755
--- a/pm/functions
+++ b/pm/functions
@@ -201,7 +201,7 @@ _rmmod() {
modunload()
{
local MOD D C USED MODS I
- local UNL="$(echo $1 |tr -- - _)" RET=1
+ local UNL="$(echo $1 |tr - _)" RET=1
while read MOD D C USED D; do
[ "$MOD" = "$UNL" ] || continue
_______________________________________________
Pm-utils mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pm-utils