I've taken a plain text file book from Project Gutenberg (around 0.5MB) which I want to concatenate to itself n times in order to generate a large text file that I can benchmark some algorithms on. Is there a linux command I can use to achieve this? cat sounds ideal, but doesn't seem to play too nice with concatenating a file onto itself, plus does not directly address the n times part of the question.
| |||||
feedback
|
|
Two parts to this, to me - first - to use cat to output the text file to standard output, and use append to add it to another file - eg foo.txt>>bar.txt will append foo.txt to bar.txt then run it n times with
replacing n in that command with your number should work, where n is your number If you use csh, there's the 'repeat' command. repeat related parts of the answer are copied from here , and i tested it on an ubuntu 11.04 system on the default bash shell. | ||||
|
feedback
|