Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I have a script which permit to install Qt 3.3.4 But before installing, I want to verify if the user has a newer version else, I install mine. How ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2005
    Location
    Nantes (France)
    Posts
    1

    [shell] compare Qt version


    Hi,

    I have a script which permit to install Qt 3.3.4
    But before installing, I want to verify if the user has a newer version else, I install mine.

    How can I do this?

    I find the Qt directory (/usr/local/lib/Qt*.*.* or /usr/lib/Qt*.*.*) and I want to compare the end (ex : 3.3.3) with my number version (3.3.4).
    I know how take directory name (basename /usr/local/lib/Qt*) but I have a problem to compare with Qt3.3.4.
    I don't know how compare these.

    If u have any idea !!

    Have a nice day

  2. #2
    Linux Enthusiast
    Join Date
    Jan 2005
    Posts
    575
    You can use the cut command with the -d option to get either
    the whole extension or a specific field of the extension.

  3. #3
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    somehow get the name of the qt directory into the variable 'dir' and then:
    Code:
    version=`echo ${dir#*[a-zA-Z]}`

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •