sed'ing out newlines

Kevin D. Clark kclark at CetaceanNetworks.com
Mon Dec 15 18:10:37 EST 2003


Dan Barrett writes:

> I want to 
> be able to switch the value of CLASSPATH on the fly when moving from project 
> to project,

If you use X?Emacs, you might find the following script to be useful.

I wrote this because:

  1:  I use emacs

  2:  My emacs sessions tend to last for months.  Restarting emacs all
      the time is out of the question.

  3:  I wanted to be able to compile Java code from XEmacs.

  4:  I wanted to be able to muck around with my CLASSPATH variable a lot.


So, with the attached script, I could mess around with my CLASSPATH
from a shell and then easily get my XEmacs process to inherit the
changes.

Hope you find this to be useful,

--kevin
-- 
Kevin D. Clark / Cetacean Networks / Portsmouth, N.H. (USA)
cetaceannetworks.com!kclark (GnuPG ID: B280F24E)
alumni.unh.edu!kdc



#!/usr/bin/perl

# takes a local environment and prints it out in a format suitable for copying,
# pasting, and then evaling into emacs

# this beats restarting emacs hands down.

# Hint:  eval-expression is bound to M-:

print "(setq process-environment (list ";

for $var (keys(%ENV)) {
  print "\"", $var, "=", $ENV{$var}, "\" ";
}

print "))\n";




More information about the Discuss mailing list