this is what i have for my small ruby program. It may seem trivial but it doesn’t seem to be working.
#!/usr/bin/ruby
location = "/home/"
puts %x ("ls " + location)
I get an error saying this syntax error, unexpected tSTRING_BEG, expecting $end
puts %x (“ls ” + location).
Can someone offer me an explanation to what i’m doing wrong? Thank you
You need to put the brackets immediately adjacent to the
%xor it’s not syntactically valid:Like
%qand others,%xcan use[ ],{ }and< >as brackets.