mk implements shell quoting correctly (or so i believe). there is a c function to do it. also, the latest mk tutorial has a section which annunciates the rules for quoting in a reasonably clear way. the korn shell book is reputed to have a decent definition of quoting but i have not read it.