Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#20 awk error

closed-fixed
nobody
None
5
2009-11-16
2009-11-01
Anonymous
No

While running update, I get the following error from awk: AVERTISSEMENT: séquence d'échappement « \. » traitée simplement comme « . »

I'm running GNU Awk 3.1.6
--
$ ubuntuzilla.py -p firefox -a checkforupdatetext
Retrieving the version of the latest release of Firefox from the Mozilla website...
The version of Firefox currently installed is awk: AVERTISSEMENT: séquence d'échappement « \. » traitée simplement comme « . »
The latest version available from Mozilla is 3.5.4
Please refer to the detailed instructions for updating Firefox on our site, http://ubuntuzilla.sourceforge.net/#Update_Official_Mozilla_Build_of_Firefox .

If you have not yet installed the official Mozilla build with the help of the Ubuntuzilla script, and are still running the repositories version, run this script with '-install' to install the latest Mozilla build of Firefox .

Discussion

1 2 > >> (Page 1 of 2)
  • Try this one :

    firefox --version | awk -F' ' '{for (field=1; field<=NF; ++field) {if (match($field, "^[0-9.]+,$")) {print $field}}}' | sed -e 's/,//'

     
  • nanotube
    nanotube
    2009-11-01

    Hi,
    Is gnu awk now the default for ubuntu? it used to be mawk was the default...

    at any rate, see here for a fix (set mawk to be the default):
    http://ubuntuforums.org/showpost.php?p=2849206&postcount=2

     
  • Even with mawk, you can remove the \ before the . without any problem.

    $ firefox --version | mawk -F' ' '{for (field=1; field<=NF; ++field) {if (match($field, "^[0-9.]+,$")) {print $field}}}' | sed -e 's/,//'
    3.5.4

     
  • nanotube
    nanotube
    2009-11-01

    Indeed, I have just tried that myself and found that to be true. so I have just released an update which doesn't escape the . in the character class. should now work with both gawk and mawk.

    Thanks a lot for your feedback!!

     
  • nanotube
    nanotube
    2009-11-01

    • status: open --> pending-fixed
     
  • Works fine for me, thanks !

     
    • status: pending-fixed --> open-fixed
     
  • nanotube
    nanotube
    2009-11-01

    • status: open-fixed --> pending-fixed
     
  • nanotube
    nanotube
    2009-11-01

    great! thanks again for your report! :)

     
  • Mathieu
    Mathieu
    2009-11-01

    You could replace this overly complicated expression by this one, wich is much more simple:

    firefox --version | sed 's|.*\([0-9]\.[0-9]\.[0-9]\).*|\1|'

     
1 2 > >> (Page 1 of 2)