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
|