how to fix a broken fortune

noztox
  10 years ago
  5

if we open the console with automatic start programs Fortunes, like this:

 _________________________________________
/ "My answer was partly the way it was!
| Because I did not know and did not have |
| The time to check "|
| |
\ Husse Sept 2 2007 /
 -----------------------------------------
  \
   \
       ___
     {~._.~}
      (Y)
     ()~*~()
     (_)-(_)
noztox @ mint ~ $ |

after updating linux mint, Fortunes become broken like this:

/Usr/bin/mint-fortune: line 35: [: ==: unary operator expected
noztox @ mint ~ $ |

how to fix a broken fortune? simple.
The first is open the console or terminal

noztox @ mint ~ $ sudo gedit /usr/bin/mint-fortune

Last search

....
if [-x "/usr/bin/gconftool-2"]; then
    showfortunes=`gconftool-2 --get /desktop/linuxmint/terminal/ show_fortunes 2> /dev/null`
    if [$ showfortunes == "true"]; then <-- error
        show_fortune
    ...

added to be like this

...
if [-x "/usr/bin/gconftool-2"]; then
    showfortunes=`gconftool-2 --get /desktop/linuxmint/terminal/ show_fortunes 2> /dev/null`
    ok = ""
    if [$ showfortunes == $ok]; then
        show_fortune
    ...

then save and exit

if you want to try it please open a new console or a new terminal

best regards smiley