From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 21 Nov 91 19:43:32 GMT From: micro-heart-of-gold.mit.edu!wupost!zaphod.mps.ohio-state.edu!caen!uvaarpa !software.org!blakemor@bloom-beacon.mit.edu (Alex Blakemore) Subject: calling a shell script from Ada Message-ID: <1991Nov21.194332.27044@software.org> List-Id: In article <1991Nov21.035339.21527nbh@netcom.COM> nbh@netcom.COM (N.B. Hedd) wr ites: > I am trying to make a call to a UNIX shell script from within an Ada > program, have the script terminate, and return to the program. I am > able to call the system via unix_procs.execute, I think, but my program > never seems to return to the foreground. Can somebody with Verdix experience > on a Sun shed some light on this? > > Ada ---> shell script (with arguments) ---> return to Ada why dont you just use the Unix system call "system" here is a repeat of a previous posting for a similar problem using Verdix on a Sun to call an executable program the mechanism is the same with text_io; with language; with system; procedure sample is command : constant string := "shell_script param1 param2" & ascii.nul; -- replace command as appropriate, dont forget fin al null exit_code : integer; function system_call (command : in system.address) return integer; pragma interface (c, system_call); pragma interface_name (system_call, language.c_prefix & "system"); begin exit_code := system_call (command'address); if exit_code /= 0 then text_io.put_line ("system call completed normally"); else text_io.put_line ("system call returned exit code " & integer'image (exit_c ode)); end if; end sample; -- --------------------------------------------------------------------- Alex Blakemore blakemore@software.org (703) 742-7125 Software Productivity Consortium 2214 Rock Hill Rd, Herndon VA 22070