Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > General Computer Support > Ant Scripts - Find out login name

Reply
Thread Tools

Ant Scripts - Find out login name

 
 
littlemaster littlemaster is offline
Junior Member
Join Date: May 2009
Posts: 2
 
      05-22-2009
Hello,

I have an ant script that we use to deploy code. The user logs on with their id and then uses 'su' command to switch over to a user called ant.

At this time, I can use the "logname" command to get which user is logged on to the system. This returns the original username but not ant.

I need this userid to find out whether this user has access to deploy the code.

However when I try to run this command from an ant script, I do not get any output.

Can anyone help me figure out how to get the loginname or the result of this command through the ant script so that I can use it.

FYI here is the script that I use:

<target name="main" >

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

and here is the output that I get:

main:
[exec] logname: no login name
[exec] Result: 1

BUILD SUCCESSFUL
Total time: 0 seconds

Thanks
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run ant script from ant script? lionelv@gmail.com Java 6 07-26-2007 02:12 AM
how to find out which ant the eclipse is using david wolf Java 1 05-02-2006 02:57 PM
error runing ant in eclipse ant view yihucd@gmail.com Java 1 03-07-2006 08:39 PM
trouble with Hibernate and Ant (probably just Ant) john martin Java 2 04-07-2005 09:27 PM
wondering how i can launch tomcat from ant without ant hanging... Chris Bedford Java 6 12-23-2004 12:41 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57