Hacker News new | past | comments | ask | show | jobs | submit login

That doesn't fully explain it but I think I got it, each line is overwritten with what it's place on the 300th line after.

Something like

  readLineOffset = 301
  writeLineOffset = 1
  While not read eof
    line = Read(readLineOffset)
    Write(WriteLineOffset, line)
    readLineOffset ++
    writeLineOffset ++



dd reads and writes in blocks of bytes, not lines. You have to figure out where 300th line starts beforehand.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: