Hi,
I wrote a ruby code that writes to a file:
open('file.txt', 'w') {|file| file.write(arr.join("\n")) }
when I try to get the number of line counts
wc -l file.txt
I get the count as 49 instead of 50. How to overcome this? My file might not have a new line at the end. That shouldn't have prevented wc to count the number of actual lines.