This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Environment variable problem


On 5/23/2010 9:51 AM, Willie Vu wrote:

I set an environment variable in /etc/profile.d/env.sh that is loaded when Cygwin starts, like the following:

export M2_HOME=d\:/java/apache-maven-2.2.1

When it is echoed, it shows the value correctly.

$ echo $M2_HOME
d:/java/apache-maven-2.2.1

However, if I suffix it with "/bin", it becomes the following:

$ echo $M2_HOME/bin
/binava/apache-maven-2.2.1

If I run the export statement inline, then there is no problem.

$ export M2_HOME=d\:/java/apache-maven-2.2.1

$ echo $M2_HOME
d:/java/apache-maven-2.2.1

$ echo $M2_HOME/bin
d:/java/apache-maven-2.2.1/bin

Any idea?

Does your script env.sh have DOS line endings? It looks like M2_HOME ends with a carriage return. Try running d2u on env.sh.


Ken


-- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]