portable shell command output capturing