From 5461246c3ab11bde546ccaf99004213a496941a5 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Fri, 4 Mar 2011 13:45:35 -0500 Subject: [PATCH] accept an optional parameter for target directory --- grepid | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/grepid b/grepid index d6e5520..2b30d58 100755 --- a/grepid +++ b/grepid @@ -1,4 +1,8 @@ -#!/bin/sh +#!/bin/bash id="$1" -exec grep --exclude-dir .svn --color=auto -R '\<'"${id}"'\>' . +where="$2" +if [[ "$where" == "" ]]; then + where=. +fi +exec grep --exclude-dir .svn --color=auto -R '\<'"${id}"'\>' ${where}