#!/usr/bin/perl $ENV{JAVA_HOME}='/path/here'; # set other items in %ENV as appropriate exec '/usr/bin/ksh'; #### foreach (`. $profile; env`) { chomp; next unless /=/; my ($var, $value) = split(/=/, $_, 2); $ENV{$var} = $value; }