#!/bin/sh # search for a string inside files in the current directory and display the paths of files and lines where it is included. # depends on ripgrep. pattern="rg --color=never --no-heading -NLFS '$1' ." shift for a in "$@"; do pattern="${pattern} | rg --color=never -FS '$a'"; done pattern="$pattern | tr -s ' '" clear exec /bin/sh -c "$pattern"