OS X tr doesn't work; use GNU tr.