/usr/bin/mint-fortune: line 35: [: ==: unary operator expected

By | 2011/05/29

In Linux Mint Debian Edition, a recent update made the fortune script stop working. I’ll show you how to fix it!

01mintfortune

1. Open this file with nano, or your favorite editor:

sudo nano /usr/bin/mint-fortune
02mintfortune
2. Locate line 35 which looks like this:


    if [ $showfortunes == "true" ]; then        

(Tip: in nano, press Control+C to display the current line number.)

03mintfortune
3. Edit that line to remove the spaces around the double equals (==) so it then reads as:

  if [ $showfortunes=="true" ]; then  

When finished, control+X then Y to save in nano.

04mintfortune
4. Now open up a brand new terminal. mint-fortune is back!

05mintfortune

Cool!