Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show result of one subroutine in another xterm (Unix HP-UX)

Status
Not open for further replies.

dmazzini

Programmer
Jan 20, 2004
480
US
Hi guys

I have a question regarding how to show perl script output in another window terminal "xterm" without use another perl script.


I have done some tools in the past where I have different perl script per options..

Code:
my $fg = "lightgrey";
my $bg = "black";


my %OSSSVR;
$OSSSVR{hntx} = "Houston";
$OSSSVR{chil} = "Chicago";
$OSSSVR{cloh} = "Cleveland";
$OSSSVR{mokc} = "Kansas City";
$OSSSVR{mpls} = "Minneapolis";
$OSSSVR{pxaz} = "Phoenix";
$OSSSVR{sewa} = "Seattle";
$OSSSVR{tpfl} = "Tampa";


my $oss = substr(`hostname`,0,4);

my $xtermLine = "xterm -title \"$OSSSVR{$oss} UMTS MENU\" -bg $bg -fg $fg -cr $fg -geometry 170x45 -sl 10000 -fn 8x15 -sb -e /m/home/dmazzini/anotherscript_based_on_menu.pl $debug &";
system($xtermLine);

The situation is that I have a perl script with a menu, I would like to be able to show the ouput generated for the selected routine in a different xterminal using just thisperl script.

For example, I would like to show the contents of the array @data without print to a filehandle

It worked, but I am not happy with the solution...

Code:
sub...

my @data= qq(Roses Margarita 
       Daniel Felipe Perez);

my $log="datacall";

open DATACALL, ">$log" or die "cant open $log: $!\n";
print DATACALL @data;
close DATAFILL;
my $unix= "tail $log\; rm $log\; sleep 10";

my $cmd= qq(xterm -title "MONITORING" -e \"$unix\" &);
print "CMD:$cmd\n";
system($cmd);


Ideas are welcome!

Cheers



dmazzini
GSM/UMTS System and Telecomm Consultant

 
Most *nix systems have a talk/send/message/banner/chat type command which one terminal can start a communication with another. Perhaps you can change your generic print statements
from: print "xxx"
to: &echo_print("xxx")
where under the echo_print routine you can direct the output to the local terminal as well at the (chat?) window.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top