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

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -