Below, a little look at a sidebar running in issue 1.2, next to Pierre Marchand’s piece about his first time setting a book in Scribus.
Executing commands in the command line
No matter what operating system you’re using, you’ve got a command-line interface at your disposal. If you’re of a certain age, you may remember fiddling around a little with MS-DOS. Even if you never did, don’t worry about it. The command line is friendlier than you may think.
Now, because we’re all designers here, chances are good you’re using a Mac. Or, if you’re like us, Linux. The tips and commands listed below work just fine for both. If you try them in MS-DOS (under Windows), your computer may explode. We’re not quite sure, really.
Open a terminal:
On a Mac: Crack open your Applications folder and go to Utilities. There’s a program there called Terminal. Open it.
On Linux: Normally under your Accessories or System menu, you’ll find something called Terminal. Open it.
Get to the right place:
If you’ve downloaded a book from Project Gutenberg, hopefully as a plain text file (something ending with .txt), great. If not, go back and do that. But make sure to take note of where you’ve saved it.
When you opened Terminal, it should have started you up in your home directory. To make it easier to find where you’re going, open up your file browser (Finder on a Mac, or on most kind of Linux, just double click on the icon for your home directory). Navigate to where you put your file. Now, take a look at the path leading up to that. For example, if you left it in your Downloads directory, chances are good that it’ll only be one directory past home.
Once you have an idea of where you’ve put your file, go back to the Terminal. To change directories (because that’s what you’re about to do, unless you’ve left the file in your home directory), you’re going to use the cd command. It allows you to (yes!) change directories. Let’s say you’ve left your file in the Downloads directory. In your terminal, you’d type “cd Downloads” (without the quotation marks). That would take you to your Downloads directory. If, in the Downloads directory, you happened to have another directory, this one called books, for example, you’d then go “cd books” (note that it’s case sensitive).
Looking around:
Now, we’re in our fictional home/Downloads/books directory. Let’s take a look at what’s there. To get a list of the contents of a directory, just type “ls” while you’re in the directory you want to look at. It’ll turn up a list of all the files and directories contained within that directory. If you’ve gotten to the right place, ls should show you the book you’ve downloaded.
Running the script:
Now you can run the script mentioned in the article. Just copy it and paste it into your terminal. Or, if you’re reading this in print, type it. Heck, type it in regardless, just for practice!
perl -n -e ‘s/(\S)\r\n/\1 /ms; print $_;’ original.txt > withoutlinebreak.txt
Of course, you’ll want to change “original.txt” to reflect the actual file name of the book you downloaded. Then, hit Enter. If all goes well, the next time you do an ls, you’ll find a new file, called “withoutlinebreak.txt” which will be the book you downloaded, without linebreaks and ready to be conveniently typeset in Scribus.
While this may seem like a lot of complicated steps, once you get used to it, you’ll find that it’s easy, convenient and fast. And it’s just the beginning of what you can do with the command line.
And I’ll add an easy, convenient and fast method of opening terminal on Linux boxes:
Install a drop-down terminal accessible via a hotkey.
Yakuake (KDE), Tilda (Gnome), Guake (Gnome), Yeahconsole and one for Mac: Visor.
Of course all those linux ones are usable in any wm, I personally run Yakuake on gnome and xfce desktops.