Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Open UNIX Command Line From Within MF Server Express
Hi all.

Quick info: MF Server Express 4.0 SP1 running on HP-UX 11i.

I have a small problem. I need to open an single interactive UNIX shell
from within my COBOL application. The key word here is SINGLE.

If I code the following into my app:

call
"SYSTEM"
using
"${SHELL} -o vi"
& x"00"
end-call

I get what I am looking for - an interactive UNIX shell process. But,
it is actually secondary to the shell process that is created by the
intial call to "SYSTEM". So, I changed it to this:

call
"SYSTEM"
using
"exec ${SHELL} -o vi"
& x"00"
end-call

Now I get very close to what I am looking for - which is a single child
shell process relative to the COBOL application. So far so good - but
here comes a BIG wrinkle ...

I have the ENV environment variable set, which is necessary in order to
have the proper environment in the child shell process. The problem is,
the ENV gets executed twice - once for the call "SYSTEM" and another
time for the "exec ${SHELL} ..." that I am passing along. This is bad
because the ENV script is incrementing counters and doing some other
stuff that is rather lengthy. The associated problems with having it
execute twice are quite burdensome.

So - I came up with this final tweak:

display "ENV" upon environment-name
display spaces upon environment-value

call
"SYSTEM"
using
"export ENV=mystuff.env; exec ${SHELL} -o vi"
& x"00"
end-call


I'm thinking this is rather clumsy, and perhaps I am overlooking
something obvious. Does anybody have any better suggestions for a
"cleaner" way to accomplish this?

Thanks in advance!

Chris


Report this thread to moderator Post Follow-up to this message
Old Post
Chris
05-11-05 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 09:34 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.