DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4395>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4395

Ant shell script does not handle spaces in home dir path correctly

           Summary: Ant shell script does not handle spaces in home dir path
                    correctly
           Product: Ant
           Version: 1.4.1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Wrapper scripts
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I'm running Cygwin on NT 2000, and I have a space in my home directory 
name "Rick Price". Under cygwin (and probably elsewhere in UnixLand) this 
causes the bin/ant script to be unable to read the .antrc file because of an 
error in the first if statement. 

#! /bin/sh

if [ -f $HOME/.antrc ] ; then
  . $HOME/.antrc
fi

# OS specific support.  $var _must_ be set to either true or false.

Like so

$ ant
[: Price/.antrc: unknown operand
Buildfile: build.xml does not exist!
Build failed

The fix is to put the $HOME/.antrc into quotes to protect it from the shell.

Like so

#! /bin/sh

if [ -f "$HOME/.antrc" ] ; then
  . $HOME/.antrc
fi

# OS specific support.  $var _must_ be set to either true or false.

Reply via email to