Execute shell scripts from PhAB Ap's

I am trying to build a very simple button pusher application in PhAB to be
ported over to my 3-Com Audrey. I have built the buttons on a “base” window
which went well. I was able to copy the small application to my Audrey and
run it without any problems.

Now I am stuck trying to add some functionality to my buttons. I have a few
shell scripts created that I want to be executed when I push the buttons. Is
there a simple way to do this? I can’t seem to find any documentation
telling me how to do it. I have created “stub” callback functions, which
generated the sample code. But … I don’t know where to go from here. I see
that there is a blank line which I am assuming is for “my code”. But I have
no idea what I am supposed to do there. If someone can show me an example I
would greatly appreciate it.

Digging through the docs, I am wondering if I am supposed to use a
PtTerminal, or a PtTTY, and then somehow run the shell script with those.
But really, I am lost.

I am fluent in Flash, so I thought I would cheat and put a Flash Widget into
my Ap (to run the shell scripts), but I get errors when I try to run Make
any time I toss in that Widget.

Any help you may offer is greatly appreciated!! :slight_smile:


Thanks,
-Ray Dios Haque

Ray Dios Haque wrote:

I am trying to build a very simple button pusher application in PhAB to be
ported over to my 3-Com Audrey. I have built the buttons on a “base” window
which went well. I was able to copy the small application to my Audrey and
run it without any problems.

Now I am stuck trying to add some functionality to my buttons. I have a few
shell scripts created that I want to be executed when I push the buttons. Is
there a simple way to do this? I can’t seem to find any documentation
telling me how to do it. I have created “stub” callback functions, which
generated the sample code. But … I don’t know where to go from here. I see
that there is a blank line which I am assuming is for “my code”. But I have
no idea what I am supposed to do there. If someone can show me an example I
would greatly appreciate it.

Digging through the docs, I am wondering if I am supposed to use a
PtTerminal, or a PtTTY, and then somehow run the shell script with those.
But really, I am lost.

I am fluent in Flash, so I thought I would cheat and put a Flash Widget into
my Ap (to run the shell scripts), but I get errors when I try to run Make
any time I toss in that Widget.

Any help you may offer is greatly appreciated!! > :slight_smile:


Thanks,
-Ray Dios Haque

You can use the C function system() to execute anything you like.

i.e. system("/usr/scripts/myscript");

Thank you!!

I feel dumb now. I thought I had tried that. When I went back and looked,
I see that I was using “shell” not “system”.

When I used the right call, it worked great! Now I have finished my
ultra-simple, four button application launcher thing.

Thanks again,
-Ray

“Garry” <asdf34sdg@sdfasdf3.com> wrote in message
news:chd4qf$c54$1@inn.qnx.com

You can use the C function system() to execute anything you like.

i.e. system("/usr/scripts/myscript");