title: Add a random number at the end of each line of file
body: <p>I am willing to add a different random number at the end of each line of a file. I have to repeat the process a few times and each file contain about 20k lines and each line contains about 500k characters.</p>
  
  <p>The only solution I came up with so far is</p>
  
  <pre><code>file="example.txt"
  for lineIndex in $(seq 1 "$(wc -l ${file})")
  do
      lineContent=$(sed "${lineIndex}q;d" ${file})
      echo "${lineContent} $RANDOM" &gt;&gt; tmp.txt
  done
  mv tmp.txt ${file}
  </code></pre>
  
  <p>Is there a faster solution?</p>