On Sunday 01 Feb 2015 00:18:40 Adam Carter wrote:
> >   If you've su'd to root, try 'su -' instead.
> > 
> > Thank you, that was it?
> > What difference does it make and why on some boxes it has to be "su -"
> > and on others simple "su" works.
> 
> Read 'man su'. I dont really understand this stuff well enough, but a
> 'login shell', that is, one started by /bin/login, is setup with a
> different environment to a shell that's started by su (or by, say, cron).
> This is why a shell command or script may work for you when you're logged
> in, but not if you run it from cron. I'm sure other's can explain it more
> correctly and fully.

When you follow su with "-" it will login into the pwd of /root.  Without "-" 
you will find yourself in the same directorate you happened to be when you ran 
su.

-- 
Regards,
Mick

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to