Linux2010. 3. 4. 10:54
로그인 쉘을 위해 실행되는
시스템 전역 초기화 파일인 /etc/profile을 수정하면 모든 사용자에게 적용이 될것으로 예상된다.

debian 도움말에는
/etc/bash.bashrc가 존재하고 이녀석은 login shell
/etc/profile은 interactive shell에 적용된다고 되어있다.

그런데 login shell과 per-interative-shell의 차이가 멀까?

$ man bash
OPTIONS
       In  addition to the single-character shell options documented in the description of the set builtin command, bash
       interprets the following options when it is invoked:

       -c string If the -c option is present, then commands are read from string.  If  there  are  arguments  after  the
                 string, they are assigned to the positional parameters, starting with $0.
       -i        If the -i option is present, the shell is interactive.
       -l        Make bash act as if it had been invoked as a login shell (see INVOCATION below).


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

       An interactive shell is one started without non-option arguments and without the -c option whose  standard  input
       and  error  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.


FILES
       /bin/bash
              The bash executable
       /etc/profile
              The systemwide initialization file, executed for login shells
       ~/.bash_profile
              The personal initialization file, executed for login shells
       ~/.bashrc
              The individual per-interactive-shell startup file
       ~/.bash_logout
              The individual login shell cleanup file, executed when a login shell exits
       ~/.inputrc
              Individual readline initialization file

[링크 : http://linux.die.net/man/1/bash]
[링크 : http://www.lq.org/questions/linux-general-1/difference-between-normal-shell-and-login-shell-14983/]

FC6에서 내용확인
$ cat /etc/bashrc
 # /etc/bashrc

 # System wide functions and aliases
 # Environment stuff goes in /etc/profile

 # By default, we want this to get set.
 # Even for non-interactive, non-login shells.

$ cat /etc/profile
# /etc/profile

# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc

아무튼, interactive shell은 stdin와 stderr(잉? 왜 stdout이 아니지?)이 둘다 연결된 셸로
우리가 일반적으로 사용하는 녀석으로 생각된다.
결론은 login shell보다는 interactive shell용 환경변수 파일에 alias 등을 지정하는게 좋을듯 하다.
Posted by 구차니
Linux2010. 3. 2. 18:29
alias make='make -j'
를 해놨는데

gmake는 symbolic link로 make로 되어있다.

하지만 alias 특성상, 명령줄 치환을 하기 때문에
입력 당시 gmake가 비록 링크 추적으로 인해서 make가 실행되겠지만,
그렇다고 해서 make가 make -j로 치환되지는 않는다.

2010/03/02 - [프로그램 사용/gcc] - make, gmake
2010/02/26 - [Linux] - make를 더욱 빠르게 하기!


Posted by 구차니
Linux2010. 2. 26. 15:46
bash 에서 history 라고 입력하면
현재까지 입력했던 목록들이 나온다.

그 중에 원하는 번호를 실행하려면
!n
이라고 입력하면된다.

예를 들어 432번에 원하는 명령어가 있다면
!432 이라고 입력하면 된다.

[링크 : http://linux.die.net/man/1/bash]
[링크 : http://www.solanara.net/solanara/bash]
Posted by 구차니
Linux2010. 2. 18. 22:19
리눅스 마스터 공부하다가 나온녀석으로,
일정시간이 흐른뒤 자동으로 로그아웃 시키는 데 사용하는 환경변수이다.
단위는 초단위이며, bash shell 에서 지원한다.

TMOUT

If set to a value greater than zero, TMOUT is treated as the default timeout for the read builtin. The select command terminates if input does not arrive after TMOUT seconds when input is coming from a terminal. In an interactive shell, the value is interpreted as the number of seconds to wait for input after issuing the primary prompt. Bash terminates after waiting for that number of seconds if input does not arrive.


[링크 : http://linux.die.net/man/1/bash]


'Linux' 카테고리의 다른 글

bash 리다이렉션(redirection)  (0) 2010.02.22
리눅스 드라이버 / 모듈  (0) 2010.02.19
chmod(3)  (0) 2010.02.18
scp를 통한 대역폭 제한 복사(scp with bandwidth limit)  (2) 2010.02.16
Xwindow 해상도 설정하기  (0) 2010.02.16
Posted by 구차니