I am trying to write the result of a command in a text file but I can not write anything. This is my code
f directorio2 == nil
directorio2 = 'pwd'
directorio2 = directorio2.to_s
end
puts "#{directorio2}"
system "diff -rs #{directorio1} #{directorio2} > Compara.txt"
system "sed '/Sólo/d' Compara.txt"
For this case, I want to compare the files of 2 files and if you do not tell me a second file, this will be the current route. The error is given when doing
directorio2 = 'pwd'
and then when doing
system "diff -rs #{directorio1} #{directorio2} > Compara.txt"
does the first part perfectly, that is, it does the diff -rs, but I can not write it in the text file