When we install the gnuplot on Mac OS X from the source code, we encounter this strange error message:
Undefined symbols:
"_rl_forced_update_display", referenced from:
_restore_prompt in command.o
"_rl_ding", referenced from:
_alert in mouse.o
"_history_list", referenced from:
_write_history_list in history.o
"_rl_complete_with_tilde_expansion", referenced from:
_rl_complete_with_tilde_expansion$non_lazy_ptr in plot.o
"_rl_reset_after_signal", referenced from:
_main in plot.o
...
This error is due to the readline library in Mac OS X.
If you look at the /usr/lib/libreadline.dylib file, the symlink is pointing at a library file that we do not know. (Seems not familiar to me) Thus, we can solve this problem by installing libreadline from the source, and change the symlink properly. In my case:
sudo ln -s /usr/local/lib/libreadline.6.1.dylib /usr/lib/libreadline.dylib


2010/04/23 03:40 2010/04/23 03:40
Posted by 차상길.

Many Mac users use the default "Address Book", in Mac OS X, for email and stuff. However, in Snow Leopard, we cannot use lbdb (the Little Brother's Database) anymore. For more details about the problem check out this bug report. This is annoying for mutt users like me.

There are many alternative software for this, including abook, neuron, etc. But, is there any way to use the Address Book in Mac for mutt query?

Here are some tricks that I am using.

Since Address Book uses sqlite internally, you should be able to find the database file in the following path: $HOME/Library/Application Support/AddressBook/AddressBook-v22.abcddb. Then, we can write a simple script that print out the query result from the database!

Well, if you look at the database, you will see the name of each database field is too complex. But it is not very bad, you only need to look at these two tables: ZABCDEMAILADDRESS, and ZABCDRECORD. You can easily obtain what you want using one line query.

So, here is a brief how-to.
  1. Make a script something like the following. (addressbook.rb)
  2. Put this script in your $HOME/.mutt directory.
  3. Modify your .muttrc file. (set query_command="~/.mutt/addressbook.rb '%s'")
  4. Enjoy !
addressbook.rb
#!/usr/bin/env ruby
if ARGV.count != 1
   puts "Not found."
   exit 1
end

output = `sqlite3 -separator \"\t\" ~/Library/Application\\ Support/AddressBook/AddressBook-v22.abcddb 'select mail.ZADDRESS, rec.ZFIRSTNAME, rec.ZLASTNAME from ZABCDEMAILADDRESS as mail,ZABCDRECORD as rec where (mail.ZADDRESS like \"%#{ARGV[0]}%\" or rec.ZFIRSTNAME like \"%#{ARGV[0]}%\" or rec.ZLASTNAME like \"%#{ARGV[0]}%\") and rec.Z_PK=mail.ZOWNER'`

if $? != 0
   raise "Query Error"
else
   if output.empty?
       puts "Not found."
       exit 1
   end
   puts # start with blank line
   output.split("\n").each {|line|
       tuple = line.split("\t")
       if tuple.count != 3
           puts "Not found."
           exit 1
       end
       print tuple[0] + "\t" + tuple[1] + " " + tuple[2] + "\t\n"
   }
   exit 0
end

puts "Not found."
exit 1
2010/01/19 20:56 2010/01/19 20:56
Posted by 차상길.