K
Kashyap Ivaturi
Hi,
I am trying to pass a string as a command line argument to another ruby
program and I am not able to send a single backslash character as part
of that string.
Example:
test1.rb:
test2AbsolutePath = "C:\\test2.rb"
text = "Sample Ruby '\\' String"
system("ruby #{test2AbsolutePath} \"#{text}\"")
test2.rb:
text = ARGV[0]
puts "text: #{text}"
Output :
C:\>ruby test1.rb
text: Sample Ruby '' String
Please let me know how to get the backslash character in the string in
the test2.rb program.
Thanks,
Kashyap
I am trying to pass a string as a command line argument to another ruby
program and I am not able to send a single backslash character as part
of that string.
Example:
test1.rb:
test2AbsolutePath = "C:\\test2.rb"
text = "Sample Ruby '\\' String"
system("ruby #{test2AbsolutePath} \"#{text}\"")
test2.rb:
text = ARGV[0]
puts "text: #{text}"
Output :
C:\>ruby test1.rb
text: Sample Ruby '' String
Please let me know how to get the backslash character in the string in
the test2.rb program.
Thanks,
Kashyap