1 Sep
2003
1 Sep
'03
00:20
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).