bash pipe; fix input scope