using bash read instead of child shell