Split echo and pid; should fix this later for efficiency.