su while in script

I need to su to idmba while in a ksh script run as userx, is there any way to do this? TIA :confused:

su idmba -c "commands to execute as idmba user"

You may well want to add a dash ' - ' in the su statement to ensure that idmba's profile is picked up before command execution.
Would look like ...

su - idmba -c "commands to execute as idmba user"

HTH :slight_smile:

Cheers,
Cameron