ruby - How to make the say command echo a variable value in a script? -



ruby - How to make the say command echo a variable value in a script? -

i'm on mac , utilize say command @ end of scripts, so:

system('say "finished successfully"')

but if seek insert variable,

system('say "#{my_variable}"')

it doesn't work. echoes variable name.

how can come around this?

remove backticks (kernel#`):

system("say \"#{my_variable}\"")

or

system("say '#{my_variable}'")

ruby osx

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -