fix the tr call on OS X