Fwd: /lib/lsb/init-functions

Thorsten Glaser t.glaser at tarent.de
Wed Aug 5 21:06:39 BST 2020


On Wed, 5 Aug 2020, Carl Albing wrote:

>     sig=$(echo ${2:-} | sed -e 's/^-\(.*\)/\1/')
> but could be simplified to:
>     sig=${2#-}

Yes, unless this is run with set -u enabled (which I’d not do,
but people are known to do anything…), then you need:

sig=${2:-}; sig=${sig#-}

>     sig=$(echo $sig | sed -e 's/^SIG\(.*\)/\1/')
> but could be simplified to:
>     sig=${sig#SIG}

Definitely!

bye,
//mirabilos (mksh developer and maintainer)
-- 
„Cool, /usr/share/doc/mksh/examples/uhr.gz ist ja ein Grund,
mksh auf jedem System zu installieren.“
	-- XTaran auf der OpenRheinRuhr, ganz begeistert
(EN: “[…]uhr.gz is a reason to install mksh on every system.”)



More information about the Debian-init-diversity mailing list