Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!swbatl!texbell!moxie!texsun!convex!connie!rdavis From: rdavis@connie.UUCP (Ray Davis) Newsgroups: comp.unix.shell Subject: Re: bourne sh, problems with var setting in case/esac Keywords: sh, case Message-ID: Date: 15 Nov 90 19:05:53 GMT References: <1236@netmuc.UUCP> <1990Nov15.155604.16714@usenet.ins.cwru.edu> Distribution: comp Organization: Convex Computer GmbH, Frankfurt, West Germany Lines: 18 In <1990Nov15.155604.16714@usenet.ins.cwru.edu> news@usenet.ins.cwru.edu writes: >>if i don't pipe esac and not use cat, all is ok, but i want to pipe ! >Sh runs control structures with pipes in a subshell. Variables set in a >subshell cannot affect the parent's settings. It isn't the control structure that is the problem, it's the pipe. Note that in ksh (and maybe SVR? sh), the pipe causes a subshell, but redirecting the output of the case to a file does not. Note also that if you 'cat | case', the case is not in a subshell. Ray --- Ray Davis Convex Computer GmbH, Frankfurt, West Germany unido!connie!rdavis, uunet!convex!rdavis, rdavis@convex.com, +49-69-666-8081