Sample Header Ad - 728x90

What is the correct usage of $1 in a pdfgrep script?

0 votes
0 answers
26 views
I'm trying to create a simple scripted command to search for specific words within a directory of pdf files. I presently use the command: pdfgrep -Ri -C 0 '\' /media/files/pdf-all To search for TERM, and it works fine. In order to avoid having to digit the whole command I created the following script named pdfx: #!/bin/bash term=$1 pdfgrep -Ri -C 0 '\' /media/files/pdf-all So that I can simply digit pdfx TERM or whatever word I need to search for. However it does not work :( What am I doing wrong?
Asked by black-clover (383 rep)
Jul 18, 2025, 10:18 PM
Last activity: Jul 18, 2025, 11:45 PM