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