bash

4 отговора 123 прегледа
#1

bash

Imam mnogo stranen problem. Kato se kogna prez ssh kam edin komputer (debian), ne mi se izpalnjava nisto ot .bashrc. Kato izpalnja 'bash' togava veche se izpalnjava vsichko ot .bashrc. Standartnijat mi shel v /etc/passwd si e bash.
Eto tochno kakvo se poluchava

ivan@backup-server:~$ echo $SHELL
/bin/bash
ivan@server:~$ ll
bash: ll: command not found
ivan@server:~$ ps
PID TTY TIME CMD
9203 pts/0 00:00:00 bash
9521 pts/0 00:00:00 ps
ivan@server:~$ bash
ivan@server:~$ ll
total 0
ivan@server:~$ echo $SHELL
/bin/bash
ivan@server:~$ ps
PID TTY TIME CMD
9203 pts/0 00:00:00 bash
9526 pts/0 00:00:00 bash
9536 pts/0 00:00:00 ps
ivan@server:~$


njakoj ima li ideja na kakvo mozhe da se dalzhi

10x

Отговор
в отговор на ivan #2

Re: bash

почти съм сигурен че бъркам .. но все пак:
при login в системата мисля че се изпълнява .bash_profile, а не .bashrc
.bashrc се изпълнява само за приложения които се стартираш

Отговор
в отговор на klamer #3

Re: bash

И аз има такива наблютения, но може и да зависи от дистрибуцията все пак !

Отговор
в отговор на Mopт #4

Re: bash

INVOCATION
A login shell is one whose first character of argument zero is a -, or one
started with the -login flag.

An interactive shell is one whose standard input and output are both connected
to terminals (as determined by isatty(3)), or one started with the -i option.
PS1 is set and $- includes i if bash is interactive, allowing a shell script or
a startup file to test this state.

Login shells:
On login (subject to the -noprofile option):
if /etc/profile exists, source it.

if ~/.bash_profile exists, source it,
else if ~/.bash_login exists, source it,
else if ~/.profile exists, source it.

On exit:
if ~/.bash_logout exists, source it.

Non-login interactive shells:
On startup (subject to the -norc and -rcfile options):
if ~/.bashrc exists, source it.

Non-interactive shells:
On startup:
if the environment variable ENV is non-null, expand
it and source the file it names, as if the command
if [ "$ENV" ]; then . $ENV; fi
had been executed, but do not use PATH to search
for the pathname. When not started in Posix mode, bash
looks for BASH_ENV before ENV.

If Bash is invoked as sh, it tries to mimic the behavior of sh as closely as
possible. For a login shell, it attempts to source only /etc/profile and
~/.profile, in that order. The -noprofile option may still be used to disable

Отговор
в отговор на mn_t #5

Re: bash

Това е интересна и полезна информация наистина, и някак си като се замисли човек, доста добре измислено

Отговор