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



NNAAMMEE
       gg..tteemmppffiillee  - Creates a temporary file and prints the file name
       _(_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..tteemmppffiillee help
       gg..tteemmppffiillee ppiidd==_v_a_l_u_e

DDEESSCCRRIIPPTTIIOONN
       _g_._t_e_m_p_f_i_l_e  is designed for shell scripts that need to use large tempo-
       rary files.  GRASS provides a mechanism for temporary files  that  does
       not  depend on /tmp. GRASS temporary files are created in the data base
       with the assumption that there will be enough space under the data base
       for  large files.  GRASS periodically removes temporary files that have
       been left behind by programs that failed to remove them	before	termi-
       nating.


       _g_._t_e_m_p_f_i_l_e  creates  an	unique	file  and prints the name. The user is
       required to provide a process-id which will be used as part of the name
       of  the	file.  Most Unix shells provide a way to get the process id of
       the current shell.  For /bin/sh and /bin/csh this is $$.  It is	recom-
       mended that $$ be specified as the process-id for _g_._t_e_m_p_f_i_l_e.

EEXXAAMMPPLLEE
       For /bin/sh scripts the following syntax should be used:

		 temp1=`g.tempfile pid=$$`
		 temp2=`g.tempfile pid=$$`

       For /bin/csh scripts, the following can be used:

		 set temp1=`g.tempfile pid=$$`
		 set temp2=`g.tempfile pid=$$`


NNOOTTEESS
       Each  call  to  _g_._t_e_m_p_f_i_l_e  creates  a  different  (i.e.  unique) name.
       Although GRASS does eventually get around to  removing  tempfiles  that
       have  been  left  behind,  the  programmer  should make every effort to
       remove these files. They often get large and take up disk space. If you
       write  /bin/sh  scripts,  learn to use the /bin/sh _t_r_a_p command. If you
       write /bin/csh scripts, learn to use the /bin/csh _o_n_i_n_t_r command.

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.tempfile(1)
