Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!cs.utexas.edu!convex!news From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.shell Subject: Re: One line If-then-else block in csh possible? Keywords: csh programming Message-ID: <1991Feb16.142134.19813@convex.com> Date: 16 Feb 91 14:21:34 GMT References: <1991Feb13.180658.16244@msuinfo.cl.msu.edu> Sender: news@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Distribution: comp Organization: CONVEX Software Development, Richardson, TX Lines: 29 Nntp-Posting-Host: pixel.convex.com From the keyboard of harichan@eecae.uucp (Ronald Harichandran): :Is it possible to have an if-then-else-endif block on a single line? : :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 You can often work something out using /bin/test and the short-circuit booleans: [ some test ] && success || failure Evals might be coerced into helping -- haven't thought about that too much. In general, your happiness with csh will be inversely proportional to how much you try to do with it. --tom -- Tom Christiansen tchrist@convex.com convex!tchrist "All things are possible, but not all expedient." (in life, UNIX, and perl)