g.findfile(1)	       Grass User's Manual	    g.findfile(1)



NNAAMMEE
       _g_._f_i_n_d_f_i_l_e   - Searches for GRASS data base files and sets
       variables for the shell.
       _(_G_R_A_S_S _F_i_l_e _M_a_n_a_g_e_m_e_n_t _P_r_o_g_r_a_m_)

SSYYNNOOPPSSIISS
       gg..ffiinnddffiillee
       gg..ffiinnddffiillee hheellpp
       gg..ffiinnddffiillee eelleemmeenntt==_n_a_m_e [mmaappsseett==_n_a_m_e] ffiillee==_n_a_m_e

DDEESSCCRRIIPPTTIIOONN
       _g_._f_i_n_d_f_i_l_e is designed for Bourne shell scripts that  need
       to  search  for raster map layer files, vector files, site
       list files, geographic region definition (windows)  files,
       and imagery group files in the GRASS data base.

OOPPTTIIOONNSS
       If  the	user  runs  _g_._f_i_n_d_f_i_l_e without command line argu-
       ments, he will be prompted for the names of a  GRASS  ele-
       ment, file, and mapset, through the standard _p_a_r_s_e_r.

   PPaarraammeetteerrss::
       eelleemmeenntt==_n_a_m_e
	      The  data  base  element	(i.e., directory within a
	      GRASS mapset) to be searched.

       mmaappsseett==_n_a_m_e
	      The mapset in which to  search  for  the	specified
	      file  _n_a_m_e.   If	not specified, all mapsets in the
	      user's GRASS search path are searched.   Otherwise,
	      the  specified  mapset  is  searched.   As a conve-
	      nience, if specified as a single dot (.)	only  the
	      current mapset is searched.

       ffiillee==_n_a_m_e
	      The  name  of a GRASS data file (of the stated _e_l_e_-
	      _m_e_n_t type) for which to search.


OOUUTTPPUUTT
       _g_._f_i_n_d_f_i_l_e  writes  four   lines   to   standard   output:
       name='_f_i_l_e___n_a_m_e'

       mapset='_m_a_p_s_e_t___n_a_m_e'

       file='_u_n_i_x___f_i_l_e_n_a_m_e'

       fullname='_g_r_a_s_s___f_u_l_l_n_a_m_e'

       The output is _/_b_i_n_/_s_h commands to set the variable _n_a_m_e to
       the GRASS data base file name, _m_a_p_s_e_t  to  the  mapset  in
       which  the  file  resides,  and _f_i_l_e to the full UNIX path
       name for the named file.  These variables may  be  set  in
       the  _/_b_i_n_/_s_h  as  follows:  eevvaall  ``gg..ffiinnddffiillee eelleemmeenntt==_n_a_m_e
       mmaappsseett==_n_a_m_e nnaammee==_n_a_m_e``


NNOOTTEESS
       If the specified file does not exist, the  variables  will
       be set as follows: name=

       mapset=

       fullname=

       file=

       The following is a way to test for this case:

		 if [ ! "$file" ]
		 then
		      exit
		 fi


SSEEEE AALLSSOO
       _g_._a_s_k

       _g_._f_i_l_e_n_a_m_e

       _g_._g_i_s_e_n_v

       _g_._m_a_p_s_e_t_s

       _p_a_r_s_e_r

AAUUTTHHOORR
       Michael	 Shapiro,   U.S.Army   Construction   Engineering
       Research Laboratory

       _L_a_s_t _c_h_a_n_g_e_d_: _$_D_a_t_e_: _2_0_0_2_/_0_1_/_2_5 _0_5_:_4_5_:_3_3 _$



GRASS 5.0					    g.findfile(1)
