Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!linac!att!princeton!phoenix.Princeton.EDU!pfalstad From: pfalstad@phoenix.Princeton.EDU (Paul Falstad) Newsgroups: comp.unix.questions Subject: Re: background foreach in csh or for in sh? Message-ID: <7490@idunno.Princeton.EDU> Date: 25 Mar 91 03:47:12 GMT References: <1991Mar24.214129.3837@nntp-server.caltech.edu> Sender: news@idunno.Princeton.EDU Organization: League For Fighting Chartered Accountancy Lines: 25 gwoho@nntp-server.caltech.edu (g liu) wrote: >how do i do a foreach or for in the background without >writing a script file or explicitly running a new shell >or something complicated like that?? >is there a simple way to do it? sh: for i in whatever do ... done & (just stick an & after the done) I tried various ways to do this in csh, including putting the whole thing in a subshell explicitly and putting \'s at the end of every line, or embedding control-J's in the line, but it wouldn't work. There might be a simple way, but who cares? Use sh anyway; its behavior is much more predictable and reliable than csh's, especially for shell scripts. -- Paul Falstad, pfalstad@phoenix.princeton.edu | 10 PRINT "PRINCETON CS" [Your blood pressure just went up.] | 20 GOTO 10 Princeton University would like to apologize to everyone for this article.