basic implementation of GNU cat