You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Eric Fetzer <el...@yahoo.com> on 2012/08/02 22:32:20 UTC

umask from ant

I don't get it, I do the following and it crashes:
 
    <exec executable="umask">
      <arg value="0002"/>
    </exec>
 
Anyone have a clue why that would be?  I'm on redhat 5.5 (Tikanga).  I can type umask 0002 on the command line all day long...  Here's the error:
 
/app/rosstr/test.xml:5: Execute failed: java.io.IOException: Cannot run program "umask": java.io.IOException: error=2, No such file or directory
 
Thanks,
Eric

Re: umask from ant

Posted by Joe Attardi <jo...@attardi.net>.
Umask is a shell command, not a standalone binary. So you will need to
invoke your shell to run umask. Something like

<exec executable="/bin/bash">
  <arg line="-c umask 0222" />
</exec>
On Aug 2, 2012 4:57 PM, "Maurice Feskanich" <ma...@oracle.com>
wrote:

> Looks like it needs the full path to the executable.
>
> Maury
>
>
> On 08/02/12 13:36, Eric Fetzer wrote:
>
>> Sorry, ant version is 1.7.1
>>
>>
>>
>> On Aug 2, 2012, at 4:32 PM, Eric Fetzer<el...@yahoo.com>  wrote:
>>
>>  I don't get it, I do the following and it crashes:
>>>
>>>      <exec executable="umask">
>>>        <arg value="0002"/>
>>>      </exec>
>>>
>>> Anyone have a clue why that would be?  I'm on redhat 5.5 (Tikanga).  I
>>> can type umask 0002 on the command line all day long...  Here's the error:
>>>
>>> /app/rosstr/test.xml:5: Execute failed: java.io.IOException: Cannot run
>>> program "umask": java.io.IOException: error=2, No such file or directory
>>>
>>> Thanks,
>>> Eric
>>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.**org<us...@ant.apache.org>
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.**org<us...@ant.apache.org>
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Re: UNS: Re: umask from ant

Posted by Eric Fetzer <el...@yahoo.com>.
Thanks everyone, moved over to chmod.



On Aug 2, 2012, at 8:15 PM, Andreas Krey <a....@gmx.de> wrote:

> On Thu, 02 Aug 2012 16:00:11 +0000, Bruce Atherton wrote:
> ...
>> If you still can't find it, change the executable to start your shell 
>> and tell it to execute the umask command. Something like this:
>> 
>> <exec executable="/bin/sh">
>>    <arg value="-c" />
>>    <arg value="umask" />
>>    <arg value="0002" />
>> </exec>
> 
> Problem is: This will work, but won't work as expected. The umask it
> is setting is a process property, and the whole point of it being
> a builtin to the shell is that that is the only way it can affect
> other commands at all.
> 
> As it is above it will just set the umask of the shell running
> int the <exec>, and nothing more.
> 
> Andreas
> 
> -- 
> "Totally trivial. Famous last words."
> From: Linus Torvalds <torvalds@*.org>
> Date: Fri, 22 Jan 2010 07:29:21 -0800

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: UNS: Re: umask from ant

Posted by Andreas Krey <a....@gmx.de>.
On Thu, 02 Aug 2012 16:00:11 +0000, Bruce Atherton wrote:
...
> If you still can't find it, change the executable to start your shell 
> and tell it to execute the umask command. Something like this:
> 
> <exec executable="/bin/sh">
>     <arg value="-c" />
>     <arg value="umask" />
>     <arg value="0002" />
> </exec>

Problem is: This will work, but won't work as expected. The umask it
is setting is a process property, and the whole point of it being
a builtin to the shell is that that is the only way it can affect
other commands at all.

As it is above it will just set the umask of the shell running
int the <exec>, and nothing more.

Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: umask from ant

Posted by Bruce Atherton <br...@callenish.com>.
Which might be a problem on some systems, as sometimes umask is a 
built-in shell command.

Commands to find out where umask is: "which umask", "type umask".

Even if it is built in to the shell, it may still be available as an 
executable on your system. Try looking in /bin, /sbin, /usr/bin, and 
/usr/sbin.

If you still can't find it, change the executable to start your shell 
and tell it to execute the umask command. Something like this:

<exec executable="/bin/sh">
     <arg value="-c" />
     <arg value="umask" />
     <arg value="0002" />
</exec>

On 8/2/2012 1:56 PM, Maurice Feskanich wrote:
> Looks like it needs the full path to the executable.
>
> Maury
>
>
> On 08/02/12 13:36, Eric Fetzer wrote:
>> Sorry, ant version is 1.7.1
>>
>>
>>
>> On Aug 2, 2012, at 4:32 PM, Eric Fetzer<el...@yahoo.com>  wrote:
>>
>>> I don't get it, I do the following and it crashes:
>>>
>>>      <exec executable="umask">
>>>        <arg value="0002"/>
>>>      </exec>
>>>
>>> Anyone have a clue why that would be?  I'm on redhat 5.5 (Tikanga).  
>>> I can type umask 0002 on the command line all day long...  Here's 
>>> the error:
>>>
>>> /app/rosstr/test.xml:5: Execute failed: java.io.IOException: Cannot 
>>> run program "umask": java.io.IOException: error=2, No such file or 
>>> directory
>>>
>>> Thanks,
>>> Eric
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: umask from ant

Posted by Maurice Feskanich <ma...@oracle.com>.
Looks like it needs the full path to the executable.

Maury


On 08/02/12 13:36, Eric Fetzer wrote:
> Sorry, ant version is 1.7.1
>
>
>
> On Aug 2, 2012, at 4:32 PM, Eric Fetzer<el...@yahoo.com>  wrote:
>
>> I don't get it, I do the following and it crashes:
>>
>>      <exec executable="umask">
>>        <arg value="0002"/>
>>      </exec>
>>
>> Anyone have a clue why that would be?  I'm on redhat 5.5 (Tikanga).  I can type umask 0002 on the command line all day long...  Here's the error:
>>
>> /app/rosstr/test.xml:5: Execute failed: java.io.IOException: Cannot run program "umask": java.io.IOException: error=2, No such file or directory
>>
>> Thanks,
>> Eric
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: umask from ant

Posted by Eric Fetzer <el...@yahoo.com>.
Sorry, ant version is 1.7.1



On Aug 2, 2012, at 4:32 PM, Eric Fetzer <el...@yahoo.com> wrote:

> I don't get it, I do the following and it crashes:
>  
>     <exec executable="umask">
>       <arg value="0002"/>
>     </exec>
>  
> Anyone have a clue why that would be?  I'm on redhat 5.5 (Tikanga).  I can type umask 0002 on the command line all day long...  Here's the error:
>  
> /app/rosstr/test.xml:5: Execute failed: java.io.IOException: Cannot run program "umask": java.io.IOException: error=2, No such file or directory
>  
> Thanks,
> Eric

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org