#!/usr/bin/perl -w # Usage: eval `importenv ~/.MacOSX/environment.plist` # Add the above line to your .profile, .bashrc, .cshrc, .tcshrc # to make sure that the environment variables described in # ~/.MacOSX/environment.plist are also set in your (remote, i.e. ssh) # shell logins. if ($ENV{SHELL} =~ m/.*csh/) { $format = "setenv %s '%s';\n"; } else { $format = "export %s='%s';\n"; } while (<>) { if (m|(.*)|) { $key = $1; } if (m|(.*)|) { printf($format, $key, $1); } }