As Glenn Jackman notes, the child process cannot change the parent current working directory (or environment variables, etc.). If you do not think that you are violating the parent process using the debugger ...
A process running as part of command substitution can be written to stderr to provide output to the user, while stdout output is captured by command substitution:
cd "$(sandbox whatever)"
In cases where the sandbox command sends most of its output to stderr, but only the final 'directory in chdir to stdout. If the sandbox was a shell script, you could do it like this:
#!/bin/sh newdir="$(mktemp -dt sandobox)" {
I'm sure Ruby can do something equivalent.
source share