I am trying to use grep to automatically search for a bibtex program in a custom bin folder.
The problem is that it often returns a directory called bibtex, which means that the script cannot automatically execute the command.
How to make the grep command (or indeed the locate command) automatically ignore directories?
EDIT: current command: locate bibtex | grep "/bibtex$" -d skip | head -n1
source
share