Viewing:
#! /usr/bin/env bash
output="$(rg -iIN $@)"
lines="$(echo \"$output\" | wc -l | sed 's/ //g')"
if [ "$lines" = '1' ]; then
eval "$output"
if [ "$?" != '0' ]; then
echo "error running '$output'"
fi
else
echo "'$lines' lines"
echo "$output"
fi