🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #739

NeXTstep application needing shell environment

#739
From: Nicolas Strobel
Date: Fri, 17 Apr 1992 17:22
31 lines
2382 bytes
Help!
	I have created an IB interface around a program (called snapplot) that 
used to be run from the shell level. Snapplot would take a bunch of arguments
from the command line (like the datafile, x,y range, axis labels, etc.) and
create a postscript file of the plot.  Now the interface consists of a bunch
of text fields (one for each of the former command line arguments) and a
plot window. The NeXT program (called snapplot_next) reads in all of the
text fields, creates a commandline argument array, fires that off to the work-
horse function snapplot (now just a "normal" function--not main() ), which 
takes the info and executes all the PS (display postscript) commands to make
the plot in the plot window.
	The problem is that execution of snapplot_next by double clicking on
its icon in the File Browser (or executing the command: open snapplot_next)
does not work properly--it exits/crashes before doing anything. YET when I
start the application by entering "snapplot_next" at a terminal shell prompt,
it works fine. Apparently the core function snapplot needs the environment
given to it by the terminal/shell (the environment variables, etc.). 
	Any ideas how I can give the application a "shell-like" environment?
A very clunky way is to make a csh executable file with the command 
"snapplot_next" inside it.  This brings up a shell window and the application.
I don't want the shell window. I don't think I'm wanting to start a subprocess,
so the Subprocess.m code in Examples is probably not the answer here. If I was 
writing commercial code, I would do extensive surgery on the thousands of lines 
of code so it wouldn't rely on the "shell" environment, but it's not--a 
"mission critical app" :)

Thanks for your help!

Nick Strobel
strobel@phast.phys.washington.edu
Technical Details
Message-ID: <strobel.703531338@dirac>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!strobel

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!strobel
From: strobel@phys.washington.edu (Nicolas Strobel)
Newsgroups: comp.sys.next.programmer
Subject: NeXTstep application needing shell environment
Summary: How to give NeXTStep application a "shell-like" environment?
Message-ID: <strobel.703531338@dirac>
Date: 17 Apr 92 17:22:18 GMT
Sender: news@u.washington.edu (USENET News System)
Distribution: usa,world
Organization: University of Washington
Lines: 31