Summary: grep and show full path

From: Zsentient <zsentient_at_anosc-e.5sigcmd.army.mil>
Date: Tue Jun 24 2003 - 08:50:56 EDT
Thanks to Ken Mandelberg, Lieven Marchand, Ed Rolison, Dan Burton, and the many others who will undoubtedly have this kind solution...

grep -n $2 `pwd`"/"* /dev/null



Zsentient wrote:
> 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
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Tue Jun 24 08:57:03 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:15 EST