One line If-then-else block in csh possible?
Tony Sanders
sanders at peyote.cactus.org
Sun Feb 17 14:08:37 AEST 1991
In article <1991Feb16.142134.19813 at convex.com> tchrist at convex.COM (Tom Christiansen) writes:
>From the keyboard of harichan at eecae.uucp (Ronald Harichandran):
>:Is it possible to have an if-then-else-endif block on a single line?
Sure, no problem:
sh -c 'if [ 0 != 0 ]; then echo true; else echo false; fi' :-)
>You can often work something out using /bin/test and the short-circuit
>booleans:
>
> [ some test ] && success || failure
so much for builtin test.
>In general, your happiness with csh will be inversely proportional to how
>much you try to do with it.
But it's so much fun trying to get it to work.
-- sanders at peyote.cactus.org
First rule of software: Throw the first one away.
and so on...
More information about the Comp.unix.shell
mailing list