From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:a6b:a6c4:: with SMTP id p187-v6mr9590011ioe.65.1528082252029; Sun, 03 Jun 2018 20:17:32 -0700 (PDT) X-Received: by 2002:a9d:6183:: with SMTP id g3-v6mr487358otk.3.1528082251604; Sun, 03 Jun 2018 20:17:31 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!feeder4.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!85.12.16.70.MISMATCH!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!u74-v6no4749376itb.0!news-out.google.com!z3-v6ni64iti.0!nntp.google.com!u74-v6no4749373itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 3 Jun 2018 20:17:31 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:18f:900:f900:6600:6aff:fe37:6bdc; posting-account=AvekzAoAAABj-TclKcOWQmXwA49MFPGX NNTP-Posting-Host: 2601:18f:900:f900:6600:6aff:fe37:6bdc User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <08857a7e-59ae-423e-a683-388df808133d@googlegroups.com> Subject: Trying to execute a command from inside of Ada From: John Smith Injection-Date: Mon, 04 Jun 2018 03:17:32 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 2079 X-Received-Body-CRC: 263893249 Xref: reader02.eternal-september.org comp.lang.ada:52902 Date: 2018-06-03T20:17:31-07:00 List-Id: Hello, I found the following example: http://rosettacode.org/wiki/Execute_a_system_command#Ada And this is how I tried to adapt it to Linux: with Interfaces.C; with Ada.Text_IO; use Ada.Text_IO; with GNAT.OS_Lib; use GNAT.OS_Lib; procedure Sys_Command is Result : Integer; Arguments : Argument_List := ( 1=> new String'("bash"), 2=> new String'("ls -l ~") ); begin Spawn ( Program_Name => "bash", Args => Arguments, Output_File_Descriptor => Standout, Return_Code => Result ); for Index in Arguments'Range loop Free (Arguments (Index)); -- Free the argument list end loop; end Sys_Command; The problem is that 'ls -l ~' is not executed correctly. I don't see any out put at all. What am I doing wrong?