I am doing a quine in Ruby that will display its own code in a new file. I'm trying to do like the following to print the variable itself in the new file:
$var = "Some Code%c$var = %c%s%c % [10,34,$var,34,10]%cSome Code" % [10,34,$var,34,10]
The $var
variable is empty in the new file, and this is what I want:
Some Text
$var = "Some Code%c$var = %c%s%c % [10,34,$var,34,10]%cSome Code" % [10,34,$var,34,10]
Some Text
When I launch it, I get this in the new file:
Some Code
$var = "" % [10,$var,10]
Some Code
Help please.