#!/usr/bin/perl -w # /usr/local/bin/gethost.pl # Find out where I'm calling from open(WHOPROC, "who -m|"); # open who for reading $whoami = ; close (WHOPROC); # print "$whoami"; ($name,$port,$month,$day,$time,$host) = split(/\s+/, $whoami); chop $host; $grab = substr($host, 1,); #print "$grab\n"; # Now set the display variable $display = $grab . ':0.0'; # print "$display\n"; system "sh export DISPLAY='$display'";