Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Run a shell command in a new terminal from a perl script?

by Khen1950fx (Canon)
on Feb 01, 2012 at 01:37 UTC ( #951105=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Run a shell command in a new terminal from a perl script?
in thread Run a shell command in a new terminal from a perl script?

It can be done, but it's tricky. Here's a script that I wrote to test Module::Install and ExtUtils::MakeMaker.

#!/usr/bin/perl -l use strict; use warnings; $|=1; open STDOUT, '>-'; system("xterm -e cpan -ft Module::Install &"); close STDOUT; use CPAN; CPAN::Shell->test("ExtUtils::MakeMaker");

Update: The script requires a lot of RAM, so it may or may not work for you. Try some other commands until it works.

Update: This will probably work better for you.
#!/usr/bin/perl -l use strict; use warnings; $| =1; open STDOUT, '>-'; system("du /usr/lib/perl5 &"); close STDOUT; open STDOUT, '>-'; system("xterm -e du /usr/lib/perl5 &"); close STDOUT;


Comment on Re^3: Run a shell command in a new terminal from a perl script?
Select or Download Code
Replies are listed 'Best First'.
Re^4: Run a shell command in a new terminal from a perl script?
by ironside (Acolyte) on Feb 02, 2012 at 21:18 UTC

    That did not work.

    I got an error saying: sh: xterm: command not found

      You need to install xterm.
      sudo apt-get install xterm

      Or get the source:

      xterm

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://951105]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2015-07-31 19:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (280 votes), past polls