Am Tuesday 03 March 2009 11:10:46 schrieb Marco Bosisio:
> Hi,
>   do you know  wich user  environment variable I have to test  (executing
> a bash script)   to know  when  I am  in   "su -"   (switch user mode)   ?

Firstly, You should ask yourself why you need that information. If your script
behaves different in "su -" than a real root login, it is almost certainly
broken. Users expect that "su -" works like a real login.

You should check for any necessary capability instead.


Nevertheless,

In bash, something like
cat /proc/`cat /proc/$$/stat | cut -d " " -f 4`/cmdline

gives you the command line of the bash's parent process.

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to