[SunHELP] Summary: grep and show full path

Zsentient zsentient at anosc-e.5sigcmd.army.mil
Tue Jun 24 07:52:41 CDT 2003


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 at sunmanagers.org
> http://www.sunmanagers.org/mailman/listinfo/sunmanagers



More information about the SunHELP mailing list