Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!motcid!yeates From: yeates@motcid.UUCP (Tony J Yeates) Newsgroups: comp.unix.shell Subject: Re: One line If-then-else block in csh possible? Keywords: csh programming Message-ID: <5828@iron6.UUCP> Date: 14 Feb 91 21:41:06 GMT References: <1991Feb13.180658.16244@msuinfo.cl.msu.edu> Distribution: comp Organization: Motorola Inc., Cellular Infrastructure Div., Arlington Heights, IL Lines: 27 harichan@eecae.uucp (Ronald Harichandran) writes: >Is it possible to have an if-then-else-endif block on a single line? If () command I found this buggy on the version of csh I used, so I don't use this form anymore. Also, I don't think you can use "else" with it. >I wish to do something like >if () then > command >else > command >endif >but wish to have it in a single line like >if () then, command, else, command, endif The only thing I can think of is:- if () then ; command ; else ; command ; endif which when I try it does NOT work. The csh man page says "The words else and endif must be the first nonwhite characters on a line." Oh, it also describes the if() command bug mentioned above. Guess we're SOL!