su and su-


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting su and su-
# 1  
Old 08-16-2007
Java su and su-

Hi all,

I have some question about shell which I don't know the answer. Smilie
could anyone explain me about .

1. what is different between su and su- ?
2. what is different between execute script shell using ./ and sh ?

i.e

./dju.sh

and

sh dju.sh



-dju
# 2  
Old 08-16-2007
if you use "su", you may use the current user's env, include PATH etc.

use "su -" like to open a new user login terminal, use your own env file on your home directory. any details you need to look "man su"


"sh dju.sh" is mean use sh (a shell) to run the dju.sh(in your path) script. the shell may be "bash" or "tcsh" etc., so if you want to run dju.sh on a tcsh shell, you may type "tcsh dju.sh".

./dju.sh may be to appoint the dju.sh is on the current directory not any other place. and use the shell which in the first line of dju.sh to run this script. if not found,then run in current shell.
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question