[Pm-utils] [patch commit] [006] POSIXification of pm-utils

Victor Lowther victor.lowther at gmail.com
Mon Jan 28 14:47:48 PST 2008


On Jan 28, 2008 4:01 PM, Michael Biebl <mbiebl at gmail.com> wrote:
> 2008/1/27, Victor Lowther <victor.lowther at gmail.com>:
> > 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?
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 021-stupid-nonPOSIX-tr-option.patch
Type: text/x-diff
Size: 335 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/pm-utils/attachments/20080128/3dd851bc/attachment.patch 


More information about the Pm-utils mailing list