How can I execute aliases from my Bash shell in a Ruby script?
Here's the code:
aliases = [ 'ul', 'ur', 'dl', 'dr', 'll', 'rr', 'up', 'down', 'big', 'cen' ]
while true
a = aliases.sample
`#{a}`
puts `figlet -f doh "#{a}"`
end
I would like to:
- select a random shell alias from the
aliases
array. (These aliases are aliases that I can use in my shell as defined in my.bashrc
), - execute the selected alias,
- print the name of the selected alias to the terminal screen using
figlet
.
However:
When I execute
./mysciprt
I get:ul: command not found