Path: utzoo!attcan!uunet!snorkelwacker!apple!mips!smsc.sony.com!dce From: dce@smsc.sony.com (David Elliott) Newsgroups: comp.unix.questions Subject: Re: { and } with for in /bin/sh Keywords: for do done Message-ID: <1990Mar26.193433.13320@smsc.sony.com> Date: 26 Mar 90 19:34:33 GMT References: <237@sherpa.UUCP> <12430@smoke.BRL.MIL> Reply-To: dce@Sony.COM (David Elliott) Organization: Sony Microsystems Corp. Lines: 21 In article <12430@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: >In article <237@sherpa.UUCP> rac@sherpa.UUCP (Roger Cornelius) writes: >-I recently came across some sh code which uses { and } instead of >-do ... done in a for loop. > >It IS documented. So far as I can tell it's supported by all Bourne >shells. It's also documented that { and } work with case, though I haven't gotten into that habit yet (I've used it with for loops for about 6 years). The question I have is why it doesn't also work with while, until, and if/then/else? Maybe people wouldn't think of sh as "the Algol shell" if it were consistent on this point. ;-) -- David Elliott dce@smsc.sony.com | ...!{uunet,mips}!sonyusa!dce (408)944-4073 Help!!! The Easter Bunny is after me!!!