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



NNAAMMEE
       gg..aasskk - Prompts the user for the names of GRASS data base files.
       _(_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..aasskk hheellpp
       gg..aasskk  ttyyppee==_n_a_m_e  [pprroommpptt==_"_s_t_r_i_n_g_"]  eelleemmeenntt==_n_a_m_e [ddeesscc==_"_s_t_r_i_n_g_"] uunniixx--
       ffiillee==_n_a_m_e

DDEESSCCRRIIPPTTIIOONN
       _g_._a_s_k is designed for shell scripts that need to prompt	the  user  for
       the  name  of  a  data  base file in the user's current GRASS location.
       After _g_._a_s_k is invoked with needed parameters, it will query  the  user
       for  a  file  name  of  the specified _t_y_p_e and _e_l_e_m_e_n_t.	After the user
       responds to this query, the program will write four lines to  the  UNIX
       output file specified by _u_n_i_x_f_i_l_e.

OOPPTTIIOONNSS
   PPaarraammeetteerrss::
       ttyyppee==_n_a_m_e
	      The  type  of  query.   Options  for _n_a_m_e are _o_l_d, _n_e_w, _a_n_y, and
	      _m_a_p_s_e_t;  their functions are given  below.   "New",  "any",  and
	      "mapset" only look in the user's current mapset.

       oolldd    For  existing  data  files  anywhere in the user's mapset search
	      path.

       nneeww    Used to create a new file in the current mapset, which must  not
	      already  exist  there (if a file with this name exists there, it
	      will not be overwritten).

       aannyy    Creates a file in the current  mapset,  which  may  or  may  not
	      already  exist  there.   If  a file with this name exists in the
	      current mapset, it will be overwritten; if not, a new file  with
	      this name will be created.

       mmaappsseett For  files that must exist in the current mapset The shell write
	      wants the name of a file which  exists  in  the  user's  current
	      mapset.  This type would used instead of "old" if the file is to
	      be modified.


       pprroommpptt==
	      The prompt to be displayed to the user.  If more than one  word,
	      the prompt should be enclosed within double quotes ("").

       eelleemmeenntt==_n_a_m_e
	      The name of the GRASS data base element (i.e., directory under a
	      GRASS mapset) whose files are to be queried.

       ddeesscc==  A short description of the data base element which is meaningful
	      to  the  user.   If  description contains more than one word, it
	      should be enclosed within double quotes ("").

       uunniixxffiillee==_n_a_m_e
	      The name of a UNIX file to store the user's response.  See  next
	      section  for what is written to this file and how it can be used
	      by shell scripts.


OOUUTTPPUUTT
       Upon receiving the user's response to its  request  for	a  file  name,
       _g_._a_s_k  writes four lines to the specified _u_n_i_x_f_i_l_e; this output file is
       placed in the user's current working directory, unless otherwise speci-
       fied, and contains the following lines: name='_s_o_m_e___n_a_m_e'

       mapset='_s_o_m_e___m_a_p_s_e_t'

       fullname='_s_o_m_e___f_u_l_l_n_a_m_e'

       file='_s_o_m_e___f_u_l_l_p_a_t_h'



       The  output  is	_/_b_i_n_/_s_h  commands to set the variable _n_a_m_e to the file
       name specified by the user  (of	the  _e_l_e_m_e_n_t  and  _t_y_p_e  requested  by
       _g_._a_s_k),	_m_a_p_s_e_t to the GRASS mapset in which this file resides (or will
       be created), _f_u_l_l_n_a_m_e is the name with the mapset embedded in  it,  and
       _f_i_l_e to the full UNIX path name identifying this file.  These variables
       may be set in the _/_b_i_n_/_s_h as follows: .. uunniixxffiillee



       The . is a shell command which means read the _u_n_i_x_f_i_l_e and execute  the
       commands  found there.  It is NOT part of the _u_n_i_x_f_i_l_e name and MUST be
       followed by a space.

NNOOTTEESS
       The user may choose to simply hit the return key and not enter  a  file
       name.  If this happens 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
       _d_._a_s_k

       _g_._f_i_l_e_n_a_m_e

       _g_._f_i_n_d_f_i_l_e

       _g_._g_i_s_e_n_v

       _g_._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_3_/_0_3_/_1_6 _1_2_:_2_5_:_1_9 _$



GRASS 5.0							      g.ask(1)
