[Trisquel-users] finding particular pages within PDFs

magicbanana at gmail.com magicbanana at gmail.com
Sat Aug 30 23:34:20 CEST 2014


It is true that you have to turn the script executable. You can do that with  
'chmod +x' or from a graphical file browser (in Nautilus: right click,  
"Properties", "Permissions" tab, a box to check).

If you plan to frequently use the script, you had better move it to a  
directory listed in your PATH variable. To /usr/local/bin/ for example:
$ sudo mv pdf-page-grep /usr/local/bin/

In this way, you can run it anywhere by just typing its name.

The files in arguments can be specified in any "Shell way". The script sees a  
list of file names.

Again: if you want slightly different ways of selecting text, it is only  
about adding options to the 'grep' command. I am thinking of the following  
options:
`-i'
`-y'
`--ignore-case'
      Ignore case distinctions in both the pattern and the input files.

`-F'
`--fixed-strings'
      Interpret the pattern as a list of fixed strings, separated by
      newlines, any of which is to be matched.

`-w'
`--word-regexp'
      Select only those lines containing matches that form whole words.
      The test is that the matching substring must either be at the
      beginning of the line, or preceded by a non-word constituent
      character.  Similarly, it must be either at the end of the line or
      followed by a non-word constituent character.  Word-constituent
      characters are letters, digits, and the underscore.

`-r'
`-R'
`--recursive'
      For each directory mentioned on the command line, read and process
      all files in that directory, recursively.


More information about the Trisquel-users mailing list