I admit it - I'm stumped.
I'm trying to write a ruby script to change the directory from whatever directory I'm currently in (in Terminal) to a certain directory - we'll call it ~/Documents/my/very/deep/directory.
It appears that when I run a ruby script under Terminal, the ruby script is running in a subshell, and I can see that the working directory is changing after issung Dir.chdir(full_dir_name). However, I want to change the Terminal shell directory, just as I would using the long, drawn out, "cd ~/Documents/my/very/deep/directory" command.
I've tried issuing the "cd .........." command in backquotes, and it does work, but again, it's the subshell that changes, and not the top level shell of the Terminal window. When the ruby script completes - there I am - back in whatever directory I started in.
How to change the top level shell directory from ruby?
Thanks, Todd
I'm trying to write a ruby script to change the directory from whatever directory I'm currently in (in Terminal) to a certain directory - we'll call it ~/Documents/my/very/deep/directory.
It appears that when I run a ruby script under Terminal, the ruby script is running in a subshell, and I can see that the working directory is changing after issung Dir.chdir(full_dir_name). However, I want to change the Terminal shell directory, just as I would using the long, drawn out, "cd ~/Documents/my/very/deep/directory" command.
I've tried issuing the "cd .........." command in backquotes, and it does work, but again, it's the subshell that changes, and not the top level shell of the Terminal window. When the ruby script completes - there I am - back in whatever directory I started in.
How to change the top level shell directory from ruby?
Thanks, Todd