function findstr if test (count $argv) -lt 1 echo "Usage: findstr " return 1 end if not command -q find echo "findstr: 'find' is not installed." return 1 end if not command -q grep echo "findstr: 'grep' is not installed." return 1 end find . -type f -exec grep -Hn "$argv[1]" {} \; end