Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Open a window and execute command on it

Expand Messages
  • Arvind Autar
    Is there a function in perl that allows the user to see what commands are executed, e.g command foo should be executed, the goals are to see that foo is
    Message 1 of 6 , Dec 22, 2004
    • 0 Attachment
      Is there a function in perl that allows the user to see what commands
      are executed, e.g command 'foo' should be executed, the goals are to
      see that 'foo' is typed in the terminal and after that execution of
      'foo'. I trying to do this in a fun way. ;)


      On Tue, 21 Dec 2004 21:19:57 +0530, Suraj Jacob <suraj@...> wrote:
      >
      > if you want to open a new terminal, and execute a command in it, there
      > are two ways
      > you can execute all of them in the same line
      >
      > e.g.: my $res = `xterm;ls;cp <somefile> <anotherfile>`;
      >
      > or you could open a two way pipe to a terminal program..
      >
      > open(FH, "|xterm");
      > and use the FH handle to write to it.
      >
      > also take a look at the IPC::Open2, IPC::Open3
      >
      > there is also a module IPC::Run on CPAN, which gives you
      > full control over an executing process, so that you needn't even
      > open a terminal...
      >
      > Also, what exactly are you trying to do? Opening a terminal seems to
      > be a bad idea unless you are presenting the user an interface, or a TUI
      >
      > describe the problem, and you'll surely get better replies.
      >
      > Regards
      > Suraj Jacob
      >
      >
      > ricky_69_it wrote:
      >
      > >
      > >
      > >
      > > Hi all,
      > >
      > > I'm a really beginner Perl programmer. I'm trying to do a script on
      > > Unix. The scope is to launch some windows and execute on each some
      > > command.
      > > I'm able to open the new terminals using the system function. I'm not
      > > able to execute any UNIX command on the opened terminal.
      > > Another main problem is that when the new window is launched, due to
      > > some program like Clearcase, the .cshrc file is executed and a new
      > > pid is assigned to the process. So at this point isn't possible to
      > > get control of the right process anymore.
      > > Is there someone that can help me or explain me how go on?
      > >
      > > Thanks
      > > Ricky
      > >
      > >
      > >
      > >
      > >
      > > Unsubscribing info is here:
      > > http://help.yahoo.com/help/us/groups/groups-32.html
      > >
      > >
      > > Yahoo! Groups Sponsor
      > > ADVERTISEMENT
      > > <http://us.ard.yahoo.com/SIG=12935gg77/M=298184.5639630.6699735.3001176/D=groups/S=1705006951:HM/EXP=1103626909/A=2434971/R=0/SIG=11eeoolb0/*http://www.netflix.com/Default?mqso=60185400>
      > >
      > >
      > >
      > > ------------------------------------------------------------------------
      > > Yahoo! Groups Links
      > >
      > > * To visit your group on the web, go to:
      > > http://groups.yahoo.com/group/perl-beginner/
      > >
      > > * To unsubscribe from this group, send an email to:
      > > perl-beginner-unsubscribe@yahoogroups.com
      > > <mailto:perl-beginner-unsubscribe@yahoogroups.com?subject=Unsubscribe>
      > >
      > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
      > > Service <http://docs.yahoo.com/info/terms/>.
      > >
      > >
      >
      > --
      >
      > | Suraj Jacob | Tech Support/Pipeline | Rhythm & Hues Studios, India |
      >
      > http://www.rhythm.com/~suraj
      > Go <http://www.rhythm.com/%7Esuraj>
      >
      > #include<perl.h>
      >
      >
      > Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.