You are not logged in.

#1 2007-02-12 18:19:46

opel_corsa
Member
Registered: 2007-02-12
Posts: 2

Not sure how to use IPC here

Lets say X is a shell command that will get you into X-shell upon execution. There's a command, a module, Y that can be run only in X-shell. How can I run Y from a C++ code? I need to somehow tell my app that the environment it'll be dealing with will be X-shell and not the Linux shell. I haven't dealt with a case like that before and don't know how to incorporate IPC here. Would I take X-shell as the parent process and the spawned child as module Y? Not sure... I should point out that it's not possible to do something like "X-shell -c Y"; first X-shell has to be executed. Once in the X-shell environment, now Y can be called.

A word of wisdom is appreciated.

Offline

#2 2007-02-12 18:26:07

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Not sure how to use IPC here

use environment variables? That's the simplest solution:
X-shell sets something like "IN_X_SHELL=y", and check for that in the app (using getenv)?

Offline

#3 2007-02-12 18:46:57

opel_corsa
Member
Registered: 2007-02-12
Posts: 2

Re: Not sure how to use IPC here

Thanks. I'm a very basic Linux user and have done most of my apps in Windows... Could you please explain a bit more -in a more beginner/intermediate level- on how to achieve that (in C++)? I'm somewhat familiar with getenv and setenv etc but not sure how to implement your suggestion using them.

Offline

Board footer

Powered by FluxBB