I'm trying to set a Bash alias from a Ruby script. The intended functionality would be (from the Ruby script):
- Open ~/.bash_aliases (or something)
- Add alias line to file (e.g:
alias foo="cd /bar/blah") - Source .bash_aliases
- Exit Ruby script
- Be able to use new alias
However, using the system command doesn't work because it launches a new subshell.
Any advice?
execdoesn't launch a sub-shell, I think.