Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!cmcl2!lanl!unm-la!unmvax!charon!predict From: predict@charon.unm.edu (Andrew R. Large) Newsgroups: comp.unix.questions Subject: Re: make temp files? Message-ID: <3721@charon.unm.edu> Date: 21 Sep 88 06:38:22 GMT References: <48200010@hcx1> Reply-To: predict@charon.unm.edu.UUCP (Andrew R. Large) Organization: Management Sciences, Inc. Lines: 26 In article <48200010@hcx1> ldh@hcx1.SSD.HARRIS.COM writes: > >I was wondering if there is some "readymade" way that a shell can create a >unique temporary file, as in the C routine "mktemp(XXXXX)". Thanks! > >Leo Hinds Both csh and sh replace $$ with the current PID. Using that, you can create and use a unique tmp file name with(sh): file=/tmp/aa$$ stuff >> $file ... rm $file -- -=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=- * Andrew R. Large * ** (work) 505/255-8611 ------| Univ of New Mexico EECE Department ** *** (home) 505/888-4010 |---> Management Sciences, Inc. [MSI] *** **** _Babooshka!_ **** *** Usenet: {convex,gatech,ucbvax,csu-cs,anl-mcs}!unmvax!charon!predict *** ** Internet: predict@charon.UNM.EDU ** * If I am quoted, my employers will deny my existence. * -=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-