I'd like to be able to call one of my shortcuts (i.e., aliases) from within a ruby program. In other words, I want
system('cpl')
to be the equivalent of writing
cd ~/Documents/CPlusPlus
at the command line, because my .bash_profile
includes the line
alias cpl="cd ~/Documents/cplusplus"
I'm on a Mac OSX, and while my .bash_profile
lives in the usual place (~
), I might be writing ruby in/to any old folder. I am using Ruby 2.2.0 which is located in /usr/local/bin/ruby
.