If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > What is the difference between su and su - ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-16-04, 22:10
tanboonhoe tanboonhoe is offline
Registered User
 
Join Date: Feb 2004
Posts: 16
What is the difference between su and su - ?

I have a problem with su and su - command. Basically when I su <username>, my program works fine. If I use su - <username>, I can login without problem but when I run dbaccess (command to access database utility in informix), it gave the following errors:

"The type of terminal is unknown to the system"

FYI, I didn't get this error when I login using su <username> (without the -) and excute dbaccess command. I would appreciate if you can enlighten me. I just wonder where went wrong. Thank in advance.
Reply With Quote
  #2 (permalink)  
Old 03-17-04, 07:54
TimoV TimoV is offline
Registered User
 
Join Date: Dec 2003
Posts: 56
su - also runs the .profile etc for the user you become, whereas su without - keeps the environment as it is set for he user you where...

So in this case the terminal type set in the .profile for whomever you become is wrong. Change it to the same as is set for yourself and you should be able to use the su -
Reply With Quote
  #3 (permalink)  
Old 03-17-04, 20:50
tanboonhoe tanboonhoe is offline
Registered User
 
Join Date: Feb 2004
Posts: 16
Thanks. It is really helpful...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On