Is there way to source csh env file in Ruby?

Robert K. wrote in post #1129351:

You probably have an old version of Ruby. I tested with 1.9.3

Wow, 1.9.3 works, thank you so much.

  1. more error checking (e.g. existence of test.csh)
  2. handle variables with values that contain a newline
  3. filter, e.g. include / exclude special variable names or by entries
    already present in the current environment.

The last one is easy, just change one line

ENV[$1] ||= $2

This is really helpful for me, many thanks, Robert, very appreciated.