I have Ruby code similar to:
ok.rb
hasil = "input operator salah"
puts hasil
exec("sort ok.rb > output.txt") if fork.nil?
It just wrote all code into output.txt
. However, I only want hasil
result to be written to output.txt
. How should I modify the code for such an end result?