로그인 쉘(bashrc)이 실행이 않될때 > 리눅스

본문 바로가기

리눅스

리눅스

14. 로그인 쉘(bashrc)이 실행이 않될때

페이지 정보

작성자 관리자 댓글 0건 조회 7,559회 작성일 21-01-29 06:55

본문

14. 로그인 쉘(bashrc)이 실행이 않될때

사용자 로그인쉘은 .bash_profile과 .bashrc 입니다.



jklee@spectacless:~$ ls -al

total 44

drwxr-xr-x 7 jklee jklee 4096 Jan 25 02:28 .

drwxr-xr-x 4 root  root  4096 Jan 14 15:37 ..

-rw------- 1 jklee jklee 1985 Jan 25 02:29 .bash_history

-rw-rw-r-- 1 jklee jklee  133 Jan 24 14:56 .bash_profile

-rw-rw-r-- 1 jklee jklee  147 Jan 14 16:05 .bashrc

drwxrwxr-x 4 jklee jklee 4096 Jan 18 11:16 .cache

drwxrwxr-x 5 jklee jklee 4096 Jan 15 11:04 catkin_ws

drwx------ 4 jklee jklee 4096 Jan 14 20:38 .local

drwxrwxr-x 4 jklee jklee 4096 Jan 24 15:00 .ros

drwxrwxr-x 4 jklee jklee 4096 Jan 14 18:11 service_tutorial

-rw-rw-r-- 1 jklee jklee   41 Jan 18 11:23 ws.log

jklee@spectacless:~$


.bashrc는 있는데 .bash_profile이 없을 경우 .bashrc를 실행되지 않습니다.

.bash_profile을 다음과 같이 추가하면 됩니다.

jklee@spectacless:~$ vi .bash_profile
# ~/.profile: executed by Bourne-compatible login shells.

if [ "$BASH" ]; then
  if [ -f ~/.bashrc ]; then
    . ~/.bashrc
  fi
fi

다시 로그인하면 .bashrc 가 실행됩니다.

Copyright © LEELAB.CO.KR. All rights reserved.