grep and show full path

From: Zsentient (zsentient@anosc-e.5sigcmd.army.mil)
Date: Tue Jun 24 2003 - 08:33:17 EDT


Hello,

Hoping someone might be able to refresh my memory. I have the following in a script:
grep -n $2 `pwd`"/"*
 
This works perfectly as long as there are more than one file in the directory where the grep is being executed. But, if there is only one file in the directory the full path to the file is not displayed.

I am aware that I could do a find from a parent directory and get the full path, but I would like to avoid doing a find due to the uneccessary files that would be searched, besides the files in the directory that the grep command is being executed.

Thanks, and hopefully not too trival as too make me feel completely mindless..
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:26:38 EDT