use whoami or more specifically "VarName=`whoami`"

steve

> -----Original Message-----
> From: Matthew Melvin [mailto:[EMAIL PROTECTED]]
> Sent: 26 July 2002 03:35
> To: [EMAIL PROTECTED]
> Subject: Re: Shell Script...more
> 
> 
> On Thu, 25 Jul 2002 at 9:17pm (-0500), Jesse Angell wrote:
> 
> > Hey,
> >     I need to ask more questions, who would of thought..
> > Is there any way with a shell script to see what user it's 
> being run as and
> > include that as a variable
> > So let's say.. the user: john runs it.. to have it in the 
> script check and
> > see what user is running it, and then assigning that user 
> variable $user..
> > 
> > How would I do this?
> > If it's complicated you could msg me on aim: korruptdotcom
> > or icq: 56295559
> > 
> 
> Changes are it's already in the $USER variable but if you 
> don't trust that 
> try...
> 
> user=$(id -u -n)
> 
> M.
> 
> -- 
> WebCentral Pty Ltd           Australia's #1 Internet Web 
> Hosting Company
> Level 5, 100 Wickham St.           Network Operations - 
> Systems Engineer
> PO Box 930, Fortitude Valley.                     phone: +61 
> 7 3249 2557
> Queensland, Australia 4006.                       pgp key id: 
> 0x900E515F
> 
> 
> 
> _______________________________________________
> Redhat-list mailing list
> [EMAIL PROTECTED]
> https://listman.redhat.com/mailman/listinfo/redhat-list
> 



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to