From: Glenn Jackman Date: 2009-09-04T01:15:24+09:00 Subject: Re: declare a shell alias in a ruby file At 2009-09-03 11:22AM, "jney" wrote: > Hello, > > I'm trying to declare a shell alias from a ruby file. > > here is the file test.rb : > # begin test.rb > `alias world='echo hello'` you spawn a shell, declare the alias, then the shell exits taking the alias with it. > I'm launching it : > > ruby test.rb > > Then launching the alias : > > world > -bash: world: command not found > > Does anyone know how do i declare a shell alias from a ruby file ? If you want a child process to make changes to the current process, you have to make the child tell the parent what to do and then the parent has to do it. #### alias.rb outputs shell commands puts <