replace director{y,ies} with dirname{,s}