Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Su
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Scandinavian
View previous topic :: View next topic  
Author Message
tindanos
n00b
n00b


Joined: 12 Apr 2003
Posts: 34
Location: Sweden->Gbg

PostPosted: Mon May 12, 2003 7:40 pm    Post subject: Su Reply with quote

Skulle vilja att min promt ändras till root:s promt när jag skriver su.
Har fösökt att skapa ett alias som ser ut:
Code:
alias su='su && source /etc/profile'

men det vill inte fungera. Någon som har ett bättre förslag på va dsom skall göras.
Back to top
View user's profile Send private message
Yarrick
Bodhisattva
Bodhisattva


Joined: 05 Jun 2002
Posts: 304
Location: Malmö, Sweden

PostPosted: Mon May 12, 2003 10:07 pm    Post subject: Reply with quote

jag kör med
Code:

su -
Back to top
View user's profile Send private message
tindanos
n00b
n00b


Joined: 12 Apr 2003
Posts: 34
Location: Sweden->Gbg

PostPosted: Tue May 13, 2003 12:27 pm    Post subject: Reply with quote

Tack tack ungefär vad jag sökte.
Skulle dock vilja att enbart /etc/profile läses in och inte läsa .bash_login
Back to top
View user's profile Send private message
b-llwyd
Guru
Guru


Joined: 24 Jul 2002
Posts: 302
Location: Uppsala, Sweden

PostPosted: Tue May 13, 2003 5:28 pm    Post subject: Reply with quote

Inte en lösning på ditt problem, men en förklaring:
ditt alias säger ungefär "kör su, och när det är klart kör du source /etc/profile". d v s - source /etc/profile körs först när du gått ut ur su med exit.
Back to top
View user's profile Send private message
jack the tripper
n00b
n00b


Joined: 12 May 2003
Posts: 7

PostPosted: Wed May 14, 2003 2:51 pm    Post subject: Reply with quote

vet inte om det funkar med su -
annars kan du ju lägga in en rad med "cd" i /root/.profile
Back to top
View user's profile Send private message
tindanos
n00b
n00b


Joined: 12 Apr 2003
Posts: 34
Location: Sweden->Gbg

PostPosted: Wed May 14, 2003 3:45 pm    Post subject: Reply with quote

jack the tripper wrote:
vet inte om det funkar med su -
annars kan du ju lägga in en rad med "cd" i /root/.profile


Vet nog inte vad du menar här
Back to top
View user's profile Send private message
Yarrick
Bodhisattva
Bodhisattva


Joined: 05 Jun 2002
Posts: 304
Location: Malmö, Sweden

PostPosted: Wed May 14, 2003 6:32 pm    Post subject: Reply with quote

jack the tripper wrote:
vet inte om det funkar med su -
annars kan du ju lägga in en rad med "cd" i /root/.profile


det fungerar. kör du bara su får du en vanlig grön prompt, med su - så får du en röd prompt
Back to top
View user's profile Send private message
jack the tripper
n00b
n00b


Joined: 12 May 2003
Posts: 7

PostPosted: Thu May 15, 2003 3:36 pm    Post subject: Reply with quote

Om det nu funkar så spelar det ju inte så stor roll det jag skrev, men kan ändå vara intressant för folk att veta.

filen .profile i varje användaras hemkatalog (finns där dock inte från början) kan innehålla kommandon som ska köras när användaren loggar in/startar nytt terminalfönster. Kommandot "cd" utan nån katalog tar ju användaren till sin hemkatalog.
Back to top
View user's profile Send private message
tindanos
n00b
n00b


Joined: 12 Apr 2003
Posts: 34
Location: Sweden->Gbg

PostPosted: Fri May 16, 2003 1:32 pm    Post subject: Reply with quote

jack the tripper wrote:
Om det nu funkar så spelar det ju inte så stor roll det jag skrev, men kan ändå vara intressant för folk att veta.

filen .profile i varje användaras hemkatalog (finns där dock inte från början) kan innehålla kommandon som ska köras när användaren loggar in/startar nytt terminalfönster. Kommandot "cd" utan nån katalog tar ju användaren till sin hemkatalog.


Själva essencen i problemt var ju att alla filer som .profile etc inte körs då du använder komandot su utan "-" och att när du använder su - så loggas du in på nytt dvs. du hamnar i din hem katalog och alla dina profile filer körs. Skulle alltså helst vilja kunna skriva su byta promt och env variabler dvs att /etc/proflie laddas om som om du kört source /etc/profile och inget annant alltså inte hamna i roots hemkatalog eller vem du nu su:ar till och inte behöva genomgå hela inlogningsförfrandet.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Scandinavian All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum