subshell logic