Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2005
    Nantes (France)

    [shell] compare Qt version


    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
    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
    St. Petersburg, FL
    somehow get the name of the qt directory into the variable 'dir' and then:
    version=`echo ${dir#*[a-zA-Z]}`

  4. $spacer_open

Posting Permissions

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