| Getting Started with GNU/Linux | ||
|---|---|---|
| Prev | Appendix A. Advanced: Customizing file associations with ~/.mailcap | Next |
To that end, I have created a few helper shell scripts. These have to be placed somewhere in your PATH (use echo $PATH to see what directories this includes). A typical place to put personal scripts would be ~/bin, and you may need to create the directory if it doesn't already exist.
First, for reading Word files as text, I use a script I call wordcat:
#!/bin/bash cat $* | strings | fold -s
For PDF files, I use a script I call pdfcat. It requires a program called pdftotext (you probably have it installed with xpdf, a common graphical PDF viewer).
#!/bin/bash for i in $*; do pdftotext $i - | fold -s done
Essentially, each of these scripts yank the text out of a document, break long lines on a whitespace, and dump the result to stdout. It's not beautiful, but it is certainly acceptable in the text-only environment of a modem connection.