2 Replies Latest reply on Jul 9, 2012 9:19 AM by Hemant Kurande

    chrole doesn't switch role when executed as a "NSH Script Job"

      I created a NSH script job that needs to perform actions on the targets with different roles. When I execute the NSH script from NSH window on the desktop client, it connects to the targets and when I switch the roles I do see in the agent log the new role name. However when I execute the same script on the application server using type 1 NSH script job, the script doesn't switch the role. The sample script is as follows



      ROLES="Role1 Role2 Role3 Role4"



      for role in $ROLES; do

           echo "Role $role"

           chrole $role

           cd //


           ls //<host>/tmp


      The user that executes the job has permissions for all the roles defined in this routine. It is strange that the same script will behave properly when executed in the NSH window but not via NSH script job. Has anyone seen this behavior?

      The customer is on 8.1 SP3 BSA version.