🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #37498

Re: tin in script Q (suspension doesn't work)

#37498
From: David Goh
Date: Mon, 08 Dec 1997 00:00
47 lines
1919 bytes
Argh.  I had to ignore the Followup-To header because we only have a
partial UUCP feed.  *sigh*  Oh well.  Posted *and* mailed as a result.
:-/

In news.software.readers, on 8 Dec 1997 06:04:45 GMT
andrew fabbro <NOSPAMafabbro@brokenarrow.us.itd.umich.edu> wrote:
>The script is basically:
>
>	#!/bin/sh
>	<change USER, echo change>
>	/usr/local/bin/bin -r
>	<change USER back to original, echo change>

You don't actually need to change USER back to the original, since any
environment variable modifications made inside a subshell do not
propogate to the parent shell.

So, you're probably better off doing:

=== begin ===
#!/bin/sh
# Set the USER environment variable.
USER=NOSPAM`whoami`@`domainname`
# export it, probably unnecessary, but good just in case.
export USER
# Print what we did.
echo Changed USER to "$USER"
# Exec the tin program.
exec /usr/local/bin/tin -r
=== end ===

That way, tin will replace the shell script under execution, but inherit
the newly modified USER variable.

Saves you a process too, which is a nice thing. :)

Later,

  David

-- 
Unico   Computer   Systems   Pty   Ltd
David Goh            Software Engineer
david@unico.com.au      (03) 9866 5688

Technical Details
Message-ID: <66g6lu$jqd@padre.unico.com.au>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
References: <66g2lt$i9n$1@newbabylon.rs.itd.umich.edu>

Show Full Headers
Complete Article Headers
Message-ID: <66g6lu$jqd@padre.unico.com.au>
Subject: Re: tin in script Q (suspension doesn't work)
Date: Mon, 08 Dec 1997 00:00:00 +0000
From: david@unico.com.au (David Goh)
References: <66g2lt$i9n$1@newbabylon.rs.itd.umich.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 296217907
X-newsgroup: news.software.readers
Reply-To: david@unico.com.au
X-Die-Netscrape: <blink>
Organization: UNICO Computer Systems, Melbourne, Australia
Newsgroups: news.software.readers