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
Post a Comment