Bash Script Pipe Input And Output