|
Project Information
Members
Featured
Downloads
Links
|
Lorem Ipsum Generator (lorem)I once felt a desperate need for a lorem impsum generator (if you do not know what lorem ipsum is see for example http://en.wikipedia.org/wiki/Lorem_ipsum ) that runs from the console. When I was unable to find one I had to build it myself.
Download from trunkThe latest version is available here: http://lorem.googlecode.com/svn/trunk/lorem ExamplesAlso see the screen shot above - to see what it looks like "for real" [:)]-|--< . Example 1 - Fifty wordsThe switch -n is for words and we want fifty of them. So this gives us fifty words. >lorem -n 50 lorem ipsum dolor sit amet consetetur sadipscing elitr sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat sed diam voluptua at vero eos et accusam et justo duo dolores et ea rebum stet clita kasd gubergren no sea takimata sanctus est lorem ipsum dolor sit amet (Location of line breaks may vary - there are none in the real output.) Example 2 - Five linesThe switch -l is for lines. The switch -q is for quote index (there are about 13 different sources). Values of -q should be from 0 and up. Too large values result in a text written by me (it is all variations of foobar). So for five lines from source with index 1 this is what you should write: >lorem -l 5 -q 1 oh thou in hellas deemed of heavenly birth muse formed or fabled at the minstrels will since shamed full oft by later lyres on earth mine dares not call thee from thy sacred hill yet there ive wandered by thy vaunted rill
Example 3 - 79 charactersLast switch is -c for characters (spaces count as characters). It can be used like this: >lorem -c 79 -q 11 me quedo con el transparente hombrecillo que come los huevos de la golondrina m Please note that piping this to a file results in a file with one more character than you might first expect: First we create a file with the output from 'lorem -c 15' >lorem -c 15 > /tmp/lorem15.txt Next we run the command 'wc' (word count) with the switch -c. This means that characters will be counted >wc -c /tmp/lorem15.txt 16 /tmp/lorem15.txt wc says we have 16 characters - that is annoying. But let us look at the hexdump of it using 'hd': >hd /tmp/lorem15.txt 00000000 6c 6f 72 65 6d 20 69 70 73 75 6d 20 64 6f 6c 0a |lorem ipsum dol.| 00000010 As you can see there are 15 characters of lorem and then a new-line character. Usage and optionsSynopsislorem [-n|-l|-c] N [-q M]? where N and M are integers NoteIf -n -l and/or -c are combined -l has priority over -c that has priority over -n. Options
NotesIf you are a windows user you might want to rename the file from 'lorem' to 'lorem.py' and you will probably (?) might want to run it with "python lorem.py -n 25" instead of the nix way: "lorem -n 25". You need python to run it (see http://www.python.org ). See AlsoThe ToDoList of lorem. |