Congee
2/23/2015 - 10:50 AM

Ag as a peco matcher

Ag as a peco matcher

#!/bin/sh

while read LINE; do
	if [[ -f "${LINE}" ]] &&\
	   [[ -r "${LINE}" ]] &&\
	   [[ $(ag -l "$1" "${LINE}") ]]; then
			echo "${LINE}"
	fi
done