sm-discuss AT lists.ibiblio.org
Subject: Public SourceMage Discussion List
List archive
Re: [SM-Discuss] grimoire function to check minimum kernel ver
- From: Juuso Alasuutari <iuso AT sourcemage.org>
- To: sm-discuss AT lists.ibiblio.org
- Subject: Re: [SM-Discuss] grimoire function to check minimum kernel ver
- Date: Tue, 4 Apr 2006 21:25:48 +0300
On Tuesday 04 April 2006 21:19, Jaka Kranjc wrote:
> > Alright. What difference do `` and $() have all in all?
> >
> > Juuso
>
> Not many, most of the times it shouldn't make any difference.
> $() allows for easier nesting - you don't need to escape the other
> substitutions. $() is easier to read.
OK. Thanks to you and Andrew for clarifying this, I'll use $() from now on.
Here's a rewritten version. I managed to slim it down a bit, now it uses an
array instead of counting words with wc.
function is_kernel_minimum() {
local MIN CUR a n=0
MIN=$(expr $1 : '\(^[^-]*\)')
MIN=${MIN//\./\ }
CUR=$(expr $(get_kernel_version) : '\(^[^-]*\)')
CUR=(${CUR//\./\ })
for a in $MIN; do
if (( a < ${CUR[n]=0} )); then
return 0
elif (( a > ${CUR[n]=0} )); then
return 1
fi
(( n += 1 ))
done
}
Juuso
-
[SM-Discuss] grimoire function to check minimum kernel ver,
Juuso Alasuutari, 04/02/2006
- <Possible follow-up(s)>
-
Re: [SM-Discuss] grimoire function to check minimum kernel ver,
Juuso Alasuutari, 04/04/2006
-
Re: [SM-Discuss] grimoire function to check minimum kernel ver,
sqweek, 04/04/2006
-
Re: [SM-Discuss] grimoire function to check minimum kernel ver,
Juuso Alasuutari, 04/04/2006
-
Re: [SM-Discuss] grimoire function to check minimum kernel ver,
Eric Sandall, 04/04/2006
-
Re: [SM-Discuss] grimoire function to check minimum kernel ver,
Juuso Alasuutari, 04/04/2006
-
Re: [SM-Discuss] grimoire function to check minimum kernel ver,
Andrew, 04/04/2006
- Re: [SM-Discuss] grimoire function to check minimum kernel ver, Jeremy Blosser (emrys), 04/04/2006
-
Re: [SM-Discuss] grimoire function to check minimum kernel ver,
Jaka Kranjc, 04/04/2006
- Re: [SM-Discuss] grimoire function to check minimum kernel ver, Juuso Alasuutari, 04/04/2006
-
Re: [SM-Discuss] grimoire function to check minimum kernel ver,
Andrew, 04/04/2006
-
Re: [SM-Discuss] grimoire function to check minimum kernel ver,
Juuso Alasuutari, 04/04/2006
-
Re: [SM-Discuss] grimoire function to check minimum kernel ver,
Eric Sandall, 04/04/2006
-
Re: [SM-Discuss] grimoire function to check minimum kernel ver,
Juuso Alasuutari, 04/04/2006
-
Re: [SM-Discuss] grimoire function to check minimum kernel ver,
sqweek, 04/04/2006
Archive powered by MHonArc 2.6.24.