|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: Jan 2002
Città: Trance City
Messaggi: 7298
|
shel, 1 strana cosa
salve a tutti
volevo fare 1 domanda sulla shell dell utente normale che mi da 1 scrita che nn mi dava prima e volevo capire xche' quando da utante normale si avvia il terminale in genere prima c'era 1 scritta prima del cursore che diceva localhost ecc...ecc.(adesso nn ricordo bene ora invece quando avvio il terminale prima del cursore c'e' questa scritta "bash-2.05b$" come mai ? |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Jun 2000
Città: S.Giuliano (MI)
Messaggi: 1047
|
ahò ma le dopie letere dove le hai lasciate?
comunque da pagina man bash: Codice:
PROMPTING When executing interactively, bash displays the primary prompt PS1 when it is ready to read a command, and the secondary prompt PS2 when it needs more input to complete a command. Bash allows these prompt strings to be customized by inserting a number of backslash-escaped spe_ cial characters that are decoded as follows: \a an ASCII bell character (07) \d the date in "Weekday Month Date" format (e.g., "Tue May 26") \e an ASCII escape character (033) \h the hostname up to the first `.' \H the hostname \j the number of jobs currently managed by the shell \l the basename of the shell's terminal device name \n newline \r carriage return \s the name of the shell, the basename of $0 (the portion following the final slash) \t the current time in 24-hour HH:MM:SS format \T the current time in 12-hour HH:MM:SS format \@ the current time in 12-hour am/pm format \A the current time in 24-hour HH:MM format \u the username of the current user \v the version of bash (e.g., 2.00) \V the release of bash, version + patchelvel (e.g., 2.00.0) \w the current working directory \W the basename of the current working directory \! the history number of this command \# the command number of this command \$ if the effective UID is 0, a #, otherwise a $ \nnn the character corresponding to the octal number nnn \\ a backslash \[ begin a sequence of non-printing characters, which could be used to embed a terminal control sequence into the prompt \] end a sequence of non-printing characters The command number and the history number are usually different: the history number of a com_ mand is its position in the history list, which may include commands restored from the his_ tory file (see HISTORY below), while the command number is the position in the sequence of commands executed during the current shell session. After the string is decoded, it is expanded via parameter expansion, command substitution, arithmetic expansion, and quote removal, subject to the value of the promptvars shell option (see the description of the shopt command under SHELL BUILTIN COMMANDS below). Codice:
export PS1="\u@\h:\w\$]" Codice:
gianluca@linuxhome:~$]
__________________
“No te tomes tan en serio la vida, al fin y al cabo no saldrás vivo de ella” |
![]() |
![]() |
![]() |
#3 |
Senior Member
Iscritto dal: Dec 2000
Messaggi: 1187
|
prova a dare il comando:
PS1=questashellfaschifo poi fai: PS1="\n\d \A\n[\u@\h \$(pwd)]\\$ " :-D questa e` un po piu` utile.... Quindi la forma del prompt e` determinata dalla variabile PS1, che puo` essere (ed e` solitamente..) impostata in uno degli script iniziali della bash. La forma 'bash2.0x' grezza viene quando PS1 non e` settata. Non so poi come faccia il tuo terminale ad avviare una bash che non carichi ne gli script globali (/etc/profile /etc/bashrc) ne` dell'utente (~/.bash_profile ~/.bashrc)... ma boh. Cmq per averla sempre uguale in qualunque terminale, il PS1 va messo nel file .bashrc , della home dell'utente. E va aggiunto export davanti alla definizione: export PS1="\n\d \A\n[\u@\h \$(pwd)]\\$ " (puoi addare la riga alla fine del file) Se hai vari utenti nella macchina e per qualche motivo vuoi che tutti abbiano sempre lo stesso prompt, va aggiunta a /etc/bashrc . |
![]() |
![]() |
![]() |
#4 | |
Senior Member
Iscritto dal: Jul 2002
Messaggi: 4334
|
Re: shel, 1 strana cosa
Quote:
-ls (login shell) |
|
![]() |
![]() |
![]() |
#5 |
Senior Member
Iscritto dal: Jan 2002
Città: Trance City
Messaggi: 7298
|
grazie adesso provo a vedere se riesco a capirci qualcosa
la shell e' cosi' da quando ho fatto 1 mezzo casino da root x configurare samba che poi nn ho configurato ho perso la home dell utente normale ,tutti i dati ecc ecc meno male che poi 1 di voi mi ha dato 1 mano a rimettere tutto a posto che roba complicata questo s.o. ![]() |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 19:18.