Re: Which user env. variable tell me that it is in s u - mode ?

2009-03-04 Thread Hubert Kleinmanns
- Von: Marco Bosisio marco_bosi...@it.ibm.com Gesendet: 03.03.09 14:00:17 An: LINUX-390@VM.MARIST.EDU Betreff: Re: Which user env. variable tell me that it is in s u -mode ? Hi Hubert, your suggestion works fine running for nested scripts, I created 3 script testa

Re: Which user env. variable tell me that it is in s u - mode ?

2009-03-04 Thread John Summerfield
Hubert Kleinmanns wrote: Mario, I fear, I misunderstood your question (or you misunderstood my answer ;-) ) Marco didn't explain what problem he's trying to solve, so we all have to guess. echo $SHLVL returns always 1 after a su - ..., but another value after a su ... (without th dash). I

Re: Which user env. variable tell me that it is in s u - mode ?

2009-03-04 Thread Marco Bosisio
@VM.MARIST.EDU cc Subject Re: Which user env. variable tell me that it is in s u -mode ? Mario, I fear, I misunderstood your question (or you misunderstood my answer ;-) ) echo $SHLVL returns always 1 after a su - ..., but another value after a su ... (without th dash). I thought

Re: Which user env. variable tell me that it is in s u - mode ?

2009-03-04 Thread John Summerfield
...@kleinmanns.eu Sent by: Linux on 390 Port LINUX-390@VM.MARIST.EDU 04/03/2009 09.00 Please respond to Linux on 390 Port LINUX-390@VM.MARIST.EDU To LINUX-390@VM.MARIST.EDU cc Subject Re: Which user env. variable tell me that it is in s u -mode ? Mario, I fear, I misunderstood your question

Re: Which user env. variable tell me that it is in s u - mode ?

2009-03-04 Thread Hubert Kleinmanns
echo $SHLVL returns always 1 after a su - ..., but another value after a su ... (without th dash). I thought, this was what you would like to see. There are several mechanism, to distinguish between the primary login shell and a su ... shell: I for one don't see why that might

Re: Which user env. variable tell me that it is in s u - mode ?

2009-03-04 Thread John Summerfield
Hubert Kleinmanns wrote: echo $SHLVL returns always 1 after a su - ..., but another value after a su ... (without th dash). I thought, this was what you would like to see. There are several mechanism, to distinguish between the primary login shell and a su ... shell: I for one don't see why

Re: Which user env. variable tell me that it is in s u - mode ?

2009-03-03 Thread Hubert Kleinmanns
Hi Marco, try: echo $SHLVL The value is incremented for each new sub shell - so it will be 1 for login shells (which you get with su - ... Regards Hubert -Ursprüngliche Nachricht- Von: Marco Bosisio marco_bosi...@it.ibm.com Gesendet: 03.03.09 11:12:04 An: LINUX-390@VM.MARIST.EDU

Re: Which user env. variable tell me that it is in s u - mode ?

2009-03-03 Thread John Summerfield
Hubert Kleinmanns wrote: Hi Marco, try: echo $SHLVL The value is incremented for each new sub shell - so it will be 1 for login shells (which you get with su - ... and with sudo: 21:01 [sum...@bobtail ~]$ sudo bash -c set | grep SHLVL SHLVL=1 21:02 [sum...@bobtail ~]$ -- Cheers John

Re: Which user env. variable tell me that it is in s u - mode ?

2009-03-03 Thread Christian Borntraeger
Am Tuesday 03 March 2009 13:58:59 schrieb Marco Bosisio: I customized the profile.local and it launch a script_xxx at login. When use 'su - ' I would like that the new user does not execute the script_xxx again. Ah, ok. The thing is, profile is for login shells. And with - you