Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!killer!ames!husc6!cs.utexas.edu!ut-sally!ut-emx!jjr From: jjr@ut-emx.UUCP (Jeff Rodriguez) Newsgroups: comp.unix.questions Subject: Re: what's the use of "{ list }" in /bin/sh? Message-ID: <4072@ut-emx.UUCP> Date: 10 Jul 88 17:17:25 GMT Reply-To: jjr@ut-emx.UUCP (Jeff Rodriguez) Organization: Dept. of E.E.; U. of TX at Austin Lines: 40 leo@philmds.UUCP (Leo de Wit) writes: >>Actually, it has one more use: >> >> while { setup; test } do ... >> >>or any other place where a compound statement is needed and only >>a single statement is allowed. (while and until are about it!) > >Actually, the while keyword is followed by a command-list (according to >'An Introduction to the UNIX Shell' by S.R.Bourne, Appendix A - Grammar). > >So you CAN write: > > while setup; test; do ... > >And, as I pointed out in an other posting, the '}' cannot be used as a >command separator/terminator (while ')' can). So there should be a ; or >newline after test. Why doesn't it work on my machine? Here's what I get: Script started on Sun Jul 10 12:06:46 1988 % while { date; date } do date while: Missing }. % while date; date; do date while: Expression syntax. % script done on Sun Jul 10 12:07:17 1988 I'm using an Encore multiprocessor running 4.3 BSD UNIX. On this machine, "man csh" tells me about the command while (expr) ... end but I can't find any mention of a while-do command. Jeff Rodriguez jjr@emx.utexas.edu