Path: utzoo!attcan!uunet!convex!killer!ames!pasteur!agate!bionet!apple!voder!lynx!m5 From: m5@lynx.UUCP (Mike McNally) Newsgroups: comp.unix.wizards Subject: Re: {} grouping in sh and ksh Message-ID: <4552@lynx.UUCP> Date: 5 Oct 88 23:21:57 GMT References: <12306@steinmetz.ge.com> Reply-To: m5@lynx.UUCP (Mike McNally) Organization: Lynx Real-Time Systems Inc, Campbell CA Lines: 25 In article <12306@steinmetz.ge.com> davidsen@crdos1.UUCP (bill davidsen) writes: > In sh, actions grouped by {} delimiters will be treated as a unit and >may be used with &&, ||, and redirection. If redirection is used the >commands will be executed in a subshell. After the commands have been >run, if a subshell is not used the working directory is reset, such that >it always works as if a subshell were used. > Ex: { cd ..; ps -l; pwd; ps -l; } && pwd Gee, when I try the first example on my BSD machine, sure enough the working directory is changed for the whole shell. In other words, the shell doesn't do any fancy switching back to the old wd. Maybe System V is different. -- Mike McNally Lynx Real-Time Systems uucp: {voder,athsys}!lynx!m5 phone: 408 370 2233 Where equal mind and contest equal, go.