Mailinglist Archive: opensuse (3470 mails)
| < Previous | Next > |
RE: [SLE] Scripting
- From: "Michael Sacco" <msacco01@xxxxxxxxxxxxxxxx>
- Date: Sun, 31 Aug 2003 20:20:19 -0400
- Message-id: <001b01c3701e$d6ab82c0$0e02a8c0@QuickSilver>
> This is probably either very simple or impossible. If I have a script
(Perl,
> Python, whatever), is it possible to execute an external command (say,
tar
> - -vt) and pipe the output from stdout into the script I'm currently
running? I
> don't see the syntax to do it, but I figured the gurus here would no
for
> sure.
> tia
> - ---Michael
I can't tell you exactly how to do that, but I can tell you a work
around that I used. In python I used the system() method to run a
command, eg. system("ls -la > /tmp/ls.txt") redirecting it into
/tmp/ls.txt as shown. Then I open the file using python, parse it, and
then delete it when I'm done. For my project this was fine as the file
it made in tmp was extremely small ( > 1k).
(Perl,
> Python, whatever), is it possible to execute an external command (say,
tar
> - -vt) and pipe the output from stdout into the script I'm currently
running? I
> don't see the syntax to do it, but I figured the gurus here would no
for
> sure.
> tia
> - ---Michael
I can't tell you exactly how to do that, but I can tell you a work
around that I used. In python I used the system() method to run a
command, eg. system("ls -la > /tmp/ls.txt") redirecting it into
/tmp/ls.txt as shown. Then I open the file using python, parse it, and
then delete it when I'm done. For my project this was fine as the file
it made in tmp was extremely small ( > 1k).
| < Previous | Next > |