Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bloom-beacon!paris!tytso From: tytso@paris.mit.edu (Theodore Y. Ts'o) Newsgroups: comp.unix.questions Subject: Re: if-then-else in csh alias? Message-ID: <1376@bloom-beacon.MIT.EDU> Date: Thu, 27-Aug-87 22:48:46 EDT Article-I.D.: bloom-be.1376 Posted: Thu Aug 27 22:48:46 1987 Date-Received: Sat, 29-Aug-87 13:04:48 EDT References: <16128@teknowledge-vaxc.ARPA> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: tytso@paris.UUCP (Theodore Y. Ts'o) Organization: Massachusetts Institute of Technology Lines: 19 Keywords: can it be done In article <16128@teknowledge-vaxc.ARPA> mkhaw@teknowledge-vaxc.ARPA (Not Action) writes: >Is there any way to embed newlines into alias definitions? > Let me expand the question. Is there a way to put a *foreach* in an alias definition. Try doing this: alias test 'foreach i (\!*) \ echo $i \ end' And watch your (mine, at least) csh core dump. I think it has to do with how csh determins whether you're on a interactive session or not. The same alias executed from a shell script seems to work well. P.S. Don't try this on your login shell. =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ Theodore Ts'o | mit-eddie!mit-athena!tytso | M.I.T., tytso@athena.mit.edu | P.h.D.,