Jean-sÃ©bastien Jney wrote:
I’m trying to declare a shell alias from a ruby file.
here is the file test.rb :
alias world='echo hello'
I’m launching it :
Then launching the alias :
-bash: world: command not found
Does anyone know how do i declare a shell alias from a ruby file ?
The processes are started as follows:
your shell --------------> ruby process --------> another shell
Each process is completely independent of the others - with its own
address space, and its own copy of the ENVironment. When the second
shell terminates, it cannot affect the ruby process, nor the original
shell which started that ruby process.
The only way you can do this is from the original shell itself. Either
type your alias command at the shell prompt, or put it in a file and do
The dot (.) means “read this file and execute it as commands within this
You may find the comp.unix.shell FAQ helpful.