From: Clemens Hintze Date: 2002-03-08T16:19:29+09:00 Subject: Re: Permanently change directory after exit In <000201c1c649$31a20ae0$cbfbc9c8@guara> "Guaracy Monteiro" writes: >I need change a path inside a script and stay there >after exit (without pipes etc). Can i do it? Not exactly as you want to do it. This is as any script will be started as child process of the corresponding shell which act as parent process. In UNIX and the likes it is a basement that child processes may not influence environment of parent processes. So that means, your shell have to change its directory on its own. But there is a work-around. You yould let produce your Ruby script output that will consists of shell commands, like: $ cat ~/tt.rb #!/bin/env ruby puts "cd /usr/local/doc" if now you define an alias like: alias cduldoc='eval $(~/tt.rb)' # Bash Syntax alias cduldoc 'eval `~/tt.rb`' # (T)csh Syntax or via function definition in Bourne shell ... Now you could switch to /usr/local/doc simply by typing cduldoc :-) You see, no pipes involved ;-) Ciao, \cle -- Clemens Hintze mailto: c.hintze@gmx.net