using command substitution to get rid of using a temp file