modified read command to work with ksh