Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] grimoire function to check minimum kernel ver

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • 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 20:18:34 +0300

> > function is_kernel_minimum() {
> >   local MIN CUR a b n=1
> >   MIN=`expr $1 : '\(^[^-]*\)'`
> >   MIN=${MIN//\./\ }
> >   CUR=`get_kernel_version`
> >   CUR=`expr $CUR : '\(^[^-]*\)'`
> >   CUR=${CUR//\./\ }
> >   for a in $MIN; do
> >     b=`echo $CUR | cut -d" " -f$n`
> >     if (( a < b )); then
> >       return 0
> >     elif (( a > b )); then
> >       return 1
> >     fi
> >     (( n += 1 ))
> >   done
> > }
>
> I haven't vetted this entirely, but what first caught my attention was
> the VAR=`command` assignments. I may be wrong, but I believe
> VAR=$(command) is the preferred method.
>
> -sandalle

Alright. What difference do `` and $() have all in all?

Juuso




Archive powered by MHonArc 2.6.24.

Top of Page