HDTenEightyP/NetNews huggingface dataset:
From: cogen@ll.mit.edu (David Cogen)
Newsgroups: comp.unix.shell,comp.unix.programmer
Subject: how to set parent's environment variables from shell script?
Date: 2 Oct 92 12:40:32 GMT
Organization: MIT Lincoln Laboratory, Lexington MA
Originator: cogen@ll.mit.edu (David Cogen)


I need to write a shell script which sets the environment variables of the 
caller. I am using csh, but could perhaps be convinced to use another shell
if this will make this possible.

Doing setenv in the script doesn't work, because the changes are not 
exported to the parent. I have come up with 2 solutions, neither of which are
acceptable:

1) I could 'source' the file, instead of execute it as a new process. While
this will set the caller's environment variables, I cannot parameterize a
sourced file with command-line arguments as I can a normal shell script.

2) I can run the script with 'exec <name>', and have the script terminate with
'exec $SHELL'. exec overlays the current process with the new command, and
most of the attributes of the current shell---input historary and environment variables---are preserved. However, this resets standard input, so that I cannot
run my script from within .login, for example; once my script does the exec,
the remainder of the .login is forgotten.

So, can anyone suggest a third solution, or a way to overcome the deficiencies
of my two inadequate solutions above? Please help!

David Cogen.
Xref: sparky comp.unix.shell:4213 comp.unix.programmer:4880
From: elliott@quando.quantum.de (David Elliott)
Newsgroups: comp.unix.shell,comp.unix.programmer
Subject: Re: how to set parent's environment variables from shell script?
Date: 6 Oct 92 13:55:31 GMT
Organization: Quantum Software GmbH, Dortmund, Germany
X-Newsreader: Tin 1.1 PL5

Mark Burhans (sasmob@chewy.unx.sas.com) wrote:
: In article <1992Oct2.124032.26924@ll.mit.edu>, cogen@ll.mit.edu (David Cogen) writes:
: |> 
: |> I need to write a shell script which sets the environment variables of the 
: |> caller. I am using csh, but could perhaps be convinced to use another shell
: |> if this will make this possible.
: |> 
: |> Doing setenv in the script doesn't work, because the changes are not 
: |> exported to the parent.
: 
: Precede the execution of the script with a ".".  For example with a
: script containing environment variables:
[stuff deleted]

Oh for goodness sake! He said he was using csh! '.' will not work.

But to answer the question:

You were right with your first approach - to source the shell script file.
To pass parameters to it you can do the following (a solution posted here
by someone a few months ago):

set up an alias to source the command in the .cshrc file:

alias your_command 'set argv=(\!*); shift; source /some/path/your_command\!:1'

Now when you do the following:
% your_command argument1 argument2

you can use $#, $1, etc, in you shell script.

A more general approach is to do something like the following:

alias function 'set argv=(\!*); shift; source ~/bin/CSH/\!:1'
foreach i ( ~/bin/CSH/* )
	alias $i:t function $i:t
end

I have all shell scripts which have to be written in csh (because they must
change my environment and my login shell is tcsh) in the directory 
$HOME/bin/CSH. This alias is in my .login file and has the result that
the scripts in $HOME/bin/CSH are ``autoloaded'' when I log in.
This nifty solution was also posted here several months ago by somebody else
(sorry - name forgotten).

Hope that helps!
Dave.
-- 
me    : C. David Elliott   
email : elliott@quantum.de 
jvgglfnlvatqvfpynvzrecergglcvpghejvgglfnlvatqvfpynvzrecergglcvpghejvgglfnlvatqv
fpynvzrecergglcvpgherjvgglfnlvatqvfpynvzrecergglcvpghejvgglfnlvatqvfpynvzrecerg
Xref: sparky comp.unix.dos-under-unix:77 comp.os.ms-windows.programmer.win32:1333 comp.unix.questions:11782
From: thg@cam-orl.co.uk (Tim Glauert)
Newsgroups: comp.unix.dos-under-unix,comp.os.ms-windows.programmer.win32,comp.unix.questions
Subject: Re: NT Under SCO Unix
Date: 5 Oct 92 10:11:45 GMT
Organization: Olivetti Research Ltd, Cambridge, England.

In article <id.HIRT._V7@ferranti.com>, peter@ferranti.com (peter da silva) writes:
|> In article <1af77rINN6pd@early-bird.think.com> barmar@think.com (Barry Margolin) writes:
|> > In article <id.V6PT.1RJ@ferranti.com> peter@ferranti.com (peter da silva) writes:
|> > >> Without using a standard layer such as POSIX it
|> > >> is very difficult to write sophisticated code that will run on different
|> > >> versions of Unix. Take a look at the source to xterm! :-)
|> > >X isn't UNIX.
|> 
|> > I don't think he was talking about the X-related parts, but the OS
|> > interfaces.  For instance, look at all the #ifdef's in the code that opens
|> > the pty.
|> 
|> That's all either X-related cruft or networking-related cruft (sockets, etc).

Really? I suggest that you take another look. Try main.c.

As the previous poster pointed out, there is a lot of "cruft" associated with
spawning a sub-process under different versions of Unix. That is what I was
referring to in my original remark. In fact there is no networking code in
xterm at all, and all the X code is quite standard.

|> A reasonable UNIX window system or networking software does not exist.

This sounds like an excellent reason to move to a system where such things DO
exist. NT may be such a system.

|> The worst case I can think of in real UNIX code is the terminal interface
|> stuff in Kermit. Over 100 #ifdefs in one file, but from my inspection it
|> could be considerably simplified.

In case you are interested, the R5 version of main.c has 155 #ifdefs.

I stand by my original claim: Without using a standard layer such as POSIX it
is very difficult to write sophisticated code that will run on different
versions of Unix.
Newsgroups: comp.unix.dos-under-unix,comp.os.ms-windows.programmer.win32,comp.unix.questions
From: sef@kithrup.COM (Sean Eric Fagan)
Subject: Re: NT Under SCO Unix
Organization: Kithrup Enterprises, Ltd.
Date: Wed, 30 Sep 1992 03:15:26 GMT

In article <BvDCrv.D2o@mudos.ann-arbor.mi.us> mju@mudos.ann-arbor.mi.us (Marc Unangst) writes:
>Okay.  I think I understand what you've said.  Now, I have a question
>for you: Which part of NT is it that doesn't know how to handle
>multiple users?  Is it the actual NT kernel (in which case Unix
>compatibility is more or less hopeless), or is it just the Win32 API?

The login and/or getty equivalent.

NT has user-id's.  Networking is available for it (or will be, depending on
your point of view :)).  It has been demonstrated on multiprocessing
systems; do you honestly think that only a *single* user is going to use
those?  Not bloody likely!  Most of them will probably end up file or cpu
servers.

The main obstacle in making NT allowing multiple users logging in
simultaneously is that there is no terminal interface -- it's all windowing.
But that's okay, so is X, and people use X just fine.

Like UNIX, NT is made up of smaller portions -- the "POSIX API" is one
portion, the "Windows API" is another, etc.  It may require rewriting or
replacing various portions of it, but it will, at least in some
circumstances, be possible to have multiple people using an NT machine at
the same time.  For a single processing x86 box, however, it probably won't
be *that* popular, but a 4 processor Alpha machine is an entirely different
story.

-- 
Sean Eric Fagan  | "You can't get lost in one room, no matter how
sef@kithrup.COM  |  little effort you make to learn your way around."
-----------------+    -- William E Davidsen (william@crd.GE.COM)
Any opinions expressed are my own, and generally unpopular with others.
From: wrb@teal.csn.org (William R. Bishop)
Newsgroups: comp.unix.dos-under-unix
Subject: PC+DOS Emulator Source Code for UNIX
Keywords: DOS, UNIX, Emulate
Date: 7 Oct 92 02:48:25 GMT
Organization: William R. Bishop


  Greetings DOS-doers:

  I worked on a project for over a year to develop a PC AND DOS emulator 
under unix.  This was supposed to be our "BIG" break (and it just about broke
John Stevenson-jks@nomadic.com and I).  We both had a lot to learn about 
marketing.  A lot of your potential buyers got the shakes when Microsoft 
announced their effort to bring a DOS emulator to every machine (for free?).

Please post all responses to comp.unix.dos-under-unix or Email wrb@wrb.com

  It only emulates an XT (or most of one) and a monochrome display adapter,
though it was designed to be extended.  The code traps interrupts and executes 
UNIX code for the DOS interrupts (thus obviating the need for DOS).  
Many of the important DOS calls have been emulated, but quite a few have not.
We figured to use the code as a "wrapper" around PC packages, thereby only
needing to implement the calls that a particular package uses (and what do
you know, just like most compilers use only a small subset of a machines 
instructions, most programs use only a small subset of DOS calls).

It was developed on an SGI 3030, 4D/35, and Indigo so the keyboard and 
display I/O is tailored to these machines (GL).

It runs Quicken, most of WordPerfect and Microsoft word as it sits.  The 
mouse stuff still has a few problems.

  The code has been sitting on the shelf for a year or so now, waiting for
its "BIG" break.  I am posting this notice to see how many people would be
interested in using and improving it.   Also any suggestions on how to 
support it would be appreciated (like pearl?)


                William R. Bishop (Bill) -<wrb@wrb.com>
Newsgroups: comp.unix.dos-under-unix,comp.os.ms-windows.programmer.win32,comp.unix.questions
From: apl@world.std.com (Anthony P Lawrence)
Subject: Re: NT Under SCO Unix
Organization: The World Public Access UNIX, Brookline, MA
Date: Wed, 30 Sep 1992 10:32:38 GMT

In article <1992Sep30.031526.1951@kithrup.COM> sef@kithrup.COM (Sean Eric Fagan) writes:

>The main obstacle in making NT allowing multiple users logging in
>simultaneously is that there is no terminal interface -- it's all windowing.
>But that's okay, so is X, and people use X just fine.
>
This has puzzled me.  Microsoft obviously does not see any market for
character based applications.

Yet there is a market, and it isn't teeny, so why do they cripple
NT in this way?

Is it greed? No terminal support = more cpu's on more desks = more NT
sold?

Or is it that they just don't see this part of the world at all?

Or, is it that they think the hardware will become so powerful and
inexpensive that it won't matter?


		Tony

Lawrence & Clark, Inc		(617) 762-0707	(206) 323-2864
Xenix/Unix support,etc 	 	 Boston		 Seattle

Newsgroups: comp.unix.dos-under-unix,comp.os.ms-windows.programmer.win32,comp.unix.questions
From: peter@ferranti.com (peter da silva)
Subject: Re: NT Under SCO Unix
Organization: Xenix Support, FICC
Date: Fri, 2 Oct 1992 18:14:30 GMT

In article <1992Sep30.160153.8954@terminator.cc.umich.edu> sarr@sinshan.citi.umich.edu (Sarr J. Blumson) writes:
> Prices have reached the point where the per desktop (or whatever)
> advantage of character terminals is sp marginal that it's not worth
> giving up the things they can't do, except in _very_ special cases.

Until communication prices drop by several orders of magnitude, I'm not
willing to give up the things only character terminals *can* do. Things
like PC-Anywhere to the contrary, a long distance phone connection pretty
much rules out anything else.
-- 
Peter da Silva                                          `-_-'
Ferranti Intl. Ctls. Corp.                               'U` 
Sugar Land, TX  77487-5012
+1 713 274 5180                           Heb jij vandaag je wolf al geaaid ?
Newsgroups: comp.unix.dos-under-unix,comp.os.ms-windows.programmer.win32,comp.unix.questions
From: peter@ferranti.com (peter da silva)
Subject: Re: NT Under SCO Unix
Organization: Xenix Support, FICC
Date: Fri, 2 Oct 1992 23:16:27 GMT

In article <1af77rINN6pd@early-bird.think.com> barmar@think.com (Barry Margolin) writes:
> In article <id.V6PT.1RJ@ferranti.com> peter@ferranti.com (peter da silva) writes:
> >> Without using a standard layer such as POSIX it
> >> is very difficult to write sophisticated code that will run on different
> >> versions of Unix. Take a look at the source to xterm! :-)
> >X isn't UNIX.

> I don't think he was talking about the X-related parts, but the OS
> interfaces.  For instance, look at all the #ifdef's in the code that opens
> the pty.

That's all either X-related cruft or networking-related cruft (sockets, etc).

Neither of these are UNIX. A reasonable UNIX window system or networking
software does not exist.

The worst case I can think of in real UNIX code is the terminal interface
stuff in Kermit. Over 100 #ifdefs in one file, but from my inspection it
could be considerably simplified. In any case, I've seen the equivalent
software for DOS. You have to write your own serial port interrupt handler,
and then rewrite it for every serial port card (and not even all IBM cards
are compatible: AT and XT ports are different!).

I'd love to see what the NT equivalents are, but unfortunately there isn't
any freely available NT documentation that isn't in bogocode*.
-- 
Peter da Silva                                          `-_-'
Ferranti Intl. Ctls. Corp.                               'U` 
Sugar Land, TX  77487-5012
+1 713 274 5180                           Heb jij vandaag je wolf al geaaid ?

* bogocode: anything that "vi" tells you is "not a text file".
Newsgroups: comp.unix.dos-under-unix,comp.os.ms-windows.programmer.win32,comp.unix.questions
From: apl@world.std.com (Anthony P Lawrence)
Subject: Re: Porting under UNIX (Was: Re: NT Under SCO Unix)
Organization: The World Public Access UNIX, Brookline, MA
Date: Wed, 7 Oct 1992 00:27:18 GMT

In article <KETIL.92Oct6220525@ugle.ii.uib.no> ketil@ii.uib.no writes:
>
>Well, maybe it's difficult to write portable code under Unix, I
>haven't really tried, but I have ported (compiled) quite a few
>applications to our systems.  And I find that there usually is very
>little difficulty involved.
>
>
>Sure, UNIX versions varies, but remember that if Unix had been
>produced by *one* vendor from the start, it wouldn't have become what
>it is today.

In this week's InfoWorld, Cringely reports Bill Gates as saying "NT
is essentially Unix".

Is that a mistake?  If a corporation knew they had to move from
Dos, considered Unix but decided to wait for NT thinks about it,
why wait?

On the one side you have One Vendor not quite yet producing something
that may be pretty unstable for a few years.

On the other side you have... well, we all know what we have.

Hearing Bill say that, might not the decision be "why not go with 
Unix now?"



		Tony

Lawrence & Clark, Inc		(617) 762-0707	(206) 323-2864
Xenix/Unix support,etc 	 	 Boston		 Seattle
Newsgroups: comp.unix.dos-under-unix
From: richard@crowded-house.den.mmc.com (Richard Armstrong)
Subject: Rlogin'd hostname
Organization: Martin Marietta
Date: Fri, 2 Oct 1992 17:18:27 GMT

I would like to know how the finger command resolves the hostname of the  
machine of where the user came from. (IP address)

I have code that does a finger to a file, and then I read that file to
find out the IP address of where that user came from, but I need to do
this in a manner that will identify the specific IP address of a user-id
that is used by many users telnetting in from pc's and using the same unix
user-id. 

Is there a C function that returns this remote hostname? Does anyone have
the source to finger?

Thanks.


-- 
My company never said any of this... I didn't either.
Richard Armstrong, Software Engineer, Martin Marietta
Email->>>> richard@crowded-house.den.mmc.com <<<<-Email 

Newsgroups: comp.unix.dos-under-unix
From: burd@hydra.unm.edu (Stephen Burd ASM)
Subject: General Query About DOS under UNIX software.
Date: Wed, 30 Sep 92 18:03:26 GMT
Organization: University of New Mexico, Albuquerque

I've been using SCO Opendesktop (Merge/UNIX 3.2v2) for a few years now
and I've grown quite annoyed at the bugs and limitations of the DOS
emulation.  Opendesktop has just gone to a major new release (2.0) but
I don't think my problems will be solved.  

I've gotten so fed up with the cost of SCO upgrades and the lack of
attention to DOS problems that I'm seriously considering jumping ship
to another UNIX vendor.  I need full UNIX capability (X windows, TCP/IP,
network services, csh, etc.) AND a good UNIX implementation, preferably
with an X window interface.  If anyone has a suggestion for a product
that will run reliably on PC hardware I'd be very interested to hear
about it.

The things I'm looking for that are not present in Opendesktop are, 
listed roughly in order of importance:

(1)	The ability to have multiple processes write simultaneously to a
	DOS partition.  ODT locks the entire partition as soon as any
	process opens a file.  This can be VERY annoying when running
	multiple DOS processes since most DOS software (e.g., WordPerfect
	Hardvard Graphics, etc.) opens a startup file and leaves it open
	for the duration of execution.  This could be solved by simply
	storing all my DOS software in a UNIX partition, but I have
	regular occasion to run under native DOS due to bugs in Merge
	and for greater execution speed.  At the moment, I have all of
	my regularly used DOS packages replicated between a DOS partition
	and a UNIX filesystem, at a substantial waste of disk space.

(2)	The ability to run VGA graphics in a window under X.  I'm sure
	this would be slow and memory intensive, but I'd at least like 
	the option.  ODT limits graphics in DOS X windows to CGA.

(3)	Have the mouse be recognized by DOS automatically when the X
	cursor is moved into an active DOS window.  ODT uses a hot key
	sequence with a popup menu to toggle exclusive control of the
	mouse between X and a DOS session.  This same mechanism is used 
	to toggle between window and full-screen operation (largely
	unnecessary if #2 were fixed).

(4)	The ability to access extended partitions.  ODT 2.0 does have
	this but ODT 1.1 does not.  I'm not willing to shell out $500
	just to get this without addressing the other DOS limitations.

(5)	The ability to use standard X options and resources with a DOS 
	window.  I'd like to be able to specify things like initial 
	window placement, icons, fonts, etc, using standard X command 
	line options or resource declarations.  Merge under ODT ignores 
	most command line options and some resource declarations.

Please respond by email.  I'll summarize to the net if there's general
interest.  Thanks in advance.

-- 
FROM:      Stephen D. Burd			AT&T:      (505)-277-6418
USNAIL:    Anderson School of Management        FAX:       (505)-277-7108
           University of New Mexico		INTERNET:  burd@hydra.unm.edu
           Albuquerque, NM  87131
Newsgroups: comp.unix.dos-under-unix
From: harris@progress.com (John Harris)
Subject: Re: MS-DOS under SunOS 4.1.x
Keywords: MS-DOS, SUN, UNIX
Reply-To: John.Harris@progress.com
Organization: Progress Software Corporation
Date: Wed, 30 Sep 1992 19:26:01 GMT

In article <1aa89jINN15o@seven-up.East.Sun.COM>, hans@castlerock.East.Sun.COM (Hans Hrasna) writes:
|> 
|> 	I'm interested in hearing about the software people are using to run MS-DOS
|> under SunOS... We have SunPC at work but I am looking for alternatives that I could
|> run at home on a Sun 3 machine, I can't really afford SunPC.
|> 

My experience is that a Sparc-2 is almost a minimal platform for running
most DOS applications under emulators like SoftPC.  I doubt a Sun-3 would
cut it.  Best of luck.  :)

John
-- 
----------------------------------------------------------------------------
|John Harris                    INTERNET: John.Harris@Progress.com         |
|Progress Software Corporation  AT&T-NET: 617-280-4972                     |
|14 Oak Park                                                               |
|Bedford, MA 01730            DISCLAIMER: {/usr/dlc/disclaimer.i}          |
----------------------------------------------------------------------------
Newsgroups: comp.unix.dos-under-unix,comp.os.ms-windows.programmer.win32,comp.unix.questions
From: johnhall@microsoft.com (John Hall)
Subject: Re: NT Under SCO Unix
Date: 04 Oct 92 22:15:46 GMT
Organization: Microsoft Corporation

In article @Texaco.com (Larry D. Pyeatt) writes:
| In article johnhall@microsoft.com (John Hall) writes:
| |> The 'NT' part of Windows NT is fully capable of supporting a
| |> full Unix V.4 + X11R4+ system with remote dialin ANSI terminals
| |> or remoted X windows desktops.
| 
| OK, maybe it is _capable_ of supporting several users, but does it
| now?  

Yes, just not via ANSI terminals.

| Does NT have NFS or AFS support?  

NFS is being worked on by several vendors, and MS is not allowed
to name them.

| Is a full TCP/IP implementation provided?  

Yes.

| Can I do GL, Phigs, or GKS?

No, but we do have GDI.

| I would like the Windows 32 subsystem a lot better if
| it were a little more like X.

I understand the sentiment.  However, you should understand that
Windows has more customers than X does.

-- 
-------------------------
My comments are my own.  They are independent and unrelated to the
views of my company , relatives or elected representatives.

Newsgroups: comp.unix.dos-under-unix,comp.os.ms-windows.programmer.win32,comp.unix.questions
From: sef@kithrup.COM (Sean Eric Fagan)
Subject: Re: NT Under SCO Unix
Organization: Kithrup Enterprises, Ltd.
Date: Mon, 28 Sep 1992 10:57:13 GMT

In article <1992Sep28.081443.21439@wacher.oz.au> pjw@wacher.oz.au (Peter Williams) writes:
>    Can anyone from SCO, Microsoft or anyone else in the know, tell me if 
>there is a SCO-MERGE type product in the pipeline for NT under SCO Unix. 

Although from neither SCO nor Microsoft, I can say that the answer is 'no.'

Running NT under *nix is, well, not impossible, but very difficult, since
the '386 (and later) do not virtualize, and NT, which requires protected
mode, is an OS in and of itself, and, therefore, could not live with *nix.

Running NT apps under *nix is more likely, but the answer to your *question*
is, as far as I know, "no, nobody is doing a [sic] SCO-MERGE type product"
to do that.  In the future, someone may; if NT requires dynamic linking
(which it may), then doing it is somewhat easier, *provided* that *nix
either starts out as a superset of NT, or can be made into a superset of NT.
And right now, from what I know of NT, *nix is a subset, not a superset.

Also, note that, since NT will run on more than one type of processor, you
should be more specific.  I am assuming that you really just wanted to be
able to run '386 NT applications on your SCO UNIX box; if you wanted to be
able to run MIPS NT applications on your SCO UNIX box, then almost
everything I wrote above doesn't apply, except for the part where I said
"no." 8-)

-- 
Sean Eric Fagan  | "You can't get lost in one room, no matter how
sef@kithrup.COM  |  little effort you make to learn your way around."
-----------------+    -- William E Davidsen (william@crd.GE.COM)
Any opinions expressed are my own, and generally unpopular with others.
Newsgroups: comp.unix.dos-under-unix,comp.os.ms-windows.programmer.win32,comp.unix.questions
From: pjw@wacher.oz.au (Peter Williams)
Subject: NT Under SCO Unix
Organization: Wachers Pty Ltd
Date: Mon, 28 Sep 1992 08:14:43 GMT
X-Newsreader: Tin 1.1 PL5


G'Day,

    Can anyone from SCO, Microsoft or anyone else in the know, tell me if 
there is a SCO-MERGE type product in the pipeline for NT under SCO Unix. 

Thanx.

-- 
 ,-_|\      Peter Williams                    || "To know me is to love me" ||
/     \     Wachers Pty. Ltd.                 ||  E-Mail: pjw@wacher.oz.au  ||
\_,-._/<--- 2 Humphries Ln.                   ||   Phone: +61 2 570 3255    ||
     v      Hurstville, NSW, 2220, Australia  ||     Fax: +61 2 570 9247    ||
Xref: sparky comp.unix.dos-under-unix:32 comp.os.ms-windows.programmer.win32:1197 comp.unix.questions:11544