Assigning OS Command to a var

Dear All,

Trying to assign $USERNAME to a variable as under;

def var uname as c.

uname = UNIX silent echo $USERNAME.

This doesnt work, any possible alternatives?

TIA.
 

RealHeavyDude

Well-Known Member
The OS-GETENV () function should work for you.

ASSIGN cUserName = OS-GETENV ( "USERNAME" ).


HTH, RealHeavyDude.
 

tamhas

ProgressTalk.com Sponsor
RHD's approach is the right one for an environment variable. Remember INPUT THROUGH for the more general requirement of the output of a Unix command.
 
Top