🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1788

Re: bourne sh, problems with var setting in case/esac

#1788
From: Ray Davis
Date: Thu, 15 Nov 1990 19:05
18 lines
1221 bytes
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
Technical Details
Message-ID: <rdavis.658695953@connie.convex.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!swbatl!texbell!moxie!texsun!convex!connie!rdavis
References: <1236@netmuc.UUCP> <1990Nov15.155604.16714@usenet.ins.cwru.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <rdavis.658695953@connie.convex.com>
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