support command substitution at foreach