Ant Scripts - Find out login name

Discussion in 'General Computer Support' started by littlemaster, May 22, 2009.

  1. littlemaster

    littlemaster

    Joined:
    May 22, 2009
    Messages:
    1
    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
    littlemaster, May 22, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Smlt?=

    Wireless Login Scripts

    =?Utf-8?B?Smlt?=, Apr 26, 2005, in forum: Wireless Networking
    Replies:
    1
    Views:
    6,028
    Laura E. Hunter \(MVP\)
    Apr 26, 2005
  2. =?Utf-8?B?Q29yZXk=?=

    Offline folders and Login Scripts

    =?Utf-8?B?Q29yZXk=?=, Aug 18, 2004, in forum: Microsoft Certification
    Replies:
    1
    Views:
    710
    Randy & Cindy
    Aug 19, 2004
  3. vin
    Replies:
    3
    Views:
    457
    Grog in Ohio
    Dec 18, 2003
  4. Craig Bohannon

    Login Scripts - URGENT help needed!!!!

    Craig Bohannon, Jul 15, 2003, in forum: Computer Support
    Replies:
    1
    Views:
    500
  5. Bob

    Cisco 3000 login scripts?

    Bob, Jun 9, 2006, in forum: Cisco
    Replies:
    0
    Views:
    419
Loading...

Share This Page