Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: net.unix Subject: Re: Re: /bin/true Message-ID: <736@brl-smoke.ARPA> Date: Fri, 9-May-86 18:25:51 EDT Article-I.D.: brl-smok.736 Posted: Fri May 9 18:25:51 1986 Date-Received: Sun, 25-May-86 06:29:24 EDT References: <481@batcomputer.TN.CORNELL.EDU> <518@looking.UUCP> <1110@whuxl.UUCP> <154@toram.UUCP> Reply-To: gwyn@brl.ARPA Organization: Ballistic Research Lab (BRL) Lines: 20 In article <154@toram.UUCP> chris@toram.UUCP (Chris Robertson) writes: >In shell scripts, I find setting a variable to "true" or "false" and then >simply saying "if $variable" can often make the code more readable than an >explicit "test" or using a case statement. Consider the following approach, which has lower overhead: flag= ... if [ stuff-that-needs-to-set-flag ] # for example then flag=y fi ... if [ "$flag" ] then # flag was set fi