🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1783

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

#1783
From: Conor P. Cahill
Date: Thu, 15 Nov 1990 13:35
19 lines
1226 bytes
In article <1236@netmuc.UUCP> bothe@net7.uucp writes:
>#==== start script shtest =====
>case $1 in
>esac |
>cat
>echo ++++++++++++++++ $b

The problem is any processing run in a sub-shell will not effect the 
variables in the parent shell.  Because you use a pipe, the shell
must run a sub-shell to handle the case portion of the pipeline.

>if i don't pipe esac and not use cat, all is ok, but i want to pipe !

Work out some other mechanism to get your desired results.

-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.,
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170 
Technical Details
Message-ID: <1990Nov15.133519.12390@virtech.uucp>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!uunet!virtech!cpcahil
References: <1236@netmuc.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!uunet!virtech!cpcahil
From: cpcahil@virtech.uucp (Conor P. Cahill)
Newsgroups: comp.unix.shell
Subject: Re: bourne sh, problems with var setting in case/esac
Keywords: sh, case
Message-ID: <1990Nov15.133519.12390@virtech.uucp>
Date: 15 Nov 90 13:35:19 GMT
References: <1236@netmuc.UUCP>
Reply-To: cpcahil@virtech.UUCP (Conor P. Cahill)
Distribution: comp
Organization: Virtual Technologies Inc., Sterling VA
Lines: 19