Hi Steve,

if you want to know the current user that is running you can use the id 
command: id - Return the user identity - IBM 
Documentation<https://www.ibm.com/docs/en/zos/3.1.0?topic=descriptions-id-return-user-identity>
id - Return the user identity - 
IBM<https://www.ibm.com/docs/en/zos/3.1.0?topic=descriptions-id-return-user-identity>
Description id displays the username and group affiliations of the user who 
issued the command. Specifying a user argument on the command line displays the 
same information for the given user instead of the person invoking id. In this 
case, you require appropriate permissions. The output has the format:
www.ibm.com
HTH.

Cheers - David
________________________________
Von: IBM Mainframe Discussion List <[email protected]> im Auftrag von 
MANCINI Frederic <[email protected]>
Gesendet: Freitag, 19. September 2025 10:23
An: [email protected] <[email protected]>
Betreff: Re: Displaying UID Number in USS Shell Script?

Hello Steve,

You can try processing the output of the ps command ("z/OS UNIX System
Services Command Reference") :

ps | grep $SHELL | awk '{print $1}'

Regards,
Frédéric Mancini
------------------------------------------------------------------------
*De :* Steve Estle [mailto:[email protected]]
*Envoyé :* samedi 13 septembre 2025 à 00:11
*Pour :* [email protected]
*Objet :* Displaying UID Number in USS Shell Script?

> Hello All,
>
> Debugging some ZOSMF shell script privilege issues for server pac install and 
> want to display the UID number in some batch shell scripts running with 
> BPXBATCH.  There must be some environment variable that contains the UID 
> number - I've looked / searched thru USS doc and can't seem to find a 
> comprehensive list of system environment variables.
>
> Google says it is &UID but that comes back is blank...
>
> Anyone know how to get at that via shell script?
>
> Thanks,
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email [email protected]  with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to