Mailinglist Archive: opensuse-packaging (205 mails)

< Previous Next >
Re: [opensuse-packaging] ANNOUNCE: systemd service packaging
Le lundi 26 septembre 2011 à 19:21 +0200, Jan Engelhardt a écrit :
On Monday 2011-09-26 19:03, Frederic Crozat wrote:

sysv_service=`echo $service | sed -e 's/\\.[a-z]*//g'`
\

What is it that is being stripped here? \.[a-z]* looks like it can wreak
havoc all over the string. I guess something like this goes faster:

sysv_service="$service";
sysv_service="${service%.service}";
sysv_service="${service%.unit}";

Except I don't want to list all possible extensions units might have.

Well it does not just strip extensions, it strips everything after a dot:
java1.6start.service

Well, might just as well do "${x%.*}";

Thanks, I'll do that.

if not, $service should at least be quoted.

Not sure I'm following you here..

- sysv_service=`echo $service | sed -e 's/\\.[a-z]*//g'` \
+ sysv_service=$(echo "$service" | sed -e 's/\\.[a-z]*//g') \

Ok, with above change, this is no longer needed.

--
Frederic Crozat <fcrozat@xxxxxxxx>
SUSE

--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx

< Previous Next >