½Ã½ºÅÛ °ü¸® ¹× ½Ç½À #9 |
1. ÇöÀç ½Ã½ºÅÛ¿¡¼ Á¦°øÇÏ°íÀÖ´Â shell Á¾·ù¿Í Ư¡ °Ë»öÇÏ¿© ¿ä¾à |
- shellÀÇ Á¾·ù
½© À̸§ |
½© ¼³¸í |
Bourne Shell |
AT&T º§ ¿¬±¸¼ÒÀÇ ½ºÆ¼ºê º»(Steve Bourne)ÀÌ °³¹ßÇÏ¿© AT&T ±â¹ÝÀÇ ½Ã½ºÅÛ¿¡ Á¦°øµÈ ¿À¸®Áö³Î UNIX¼ÐÀÌ´Ù. ÇÁ·Î±×·¡¹ÖÀ» ÇÏ´Â µ¥ ±ÇÀåµÇ´Â ¼ÐÀÌ¸ç ½Ã½ºÅÛ °ü¸®ÀÚ °èÁ¤ÀÎ ½´ÆÛÀ¯Àú(root)´Â ¿î¿µÃ¼°è¸¦ ¼³Ä¡ÇÒ ¶§ ±âº»°ªÀ¸·Î Á¤ÀǵǾî ÀÖ´Ù. ÀÏ¹Ý »ç¿ëÀÚÀÇ ±âº» ÇÁ·ÒÇÁÆ®´Â $ ¸ð¾çÀ̸ç, °ü¸®ÀÚ °èÁ¤ÀÎ °æ¿ì¿¡´Â # ¸ð¾çÀÌ´Ù |
C Shell |
Ķ¸®Æ÷´Ï¾Æ ¹öŬ¸® ´ëÇп¡¼ ºô Á¶ÀÌ(Bill Joy)°¡ °³¹ßÇÑ ¼ÐÀÌ´Ù. C ¾ð¾î¸¦ ±âº»À¸·Î Çϸç, Bourne Shellº¸´Ù History, Alias, Job Control°ú °°Àº ¸î¸î ÀåÁ¡À» ´õ °¡Áö°í ÀÖ´Ù. ÀÏ¹Ý »ç¿ëÀÚÀ¸ ±âº» ÇÁ·ÒÇÁÆ®´Â È£½ºÆ® À̸§µÚ¿¡ % Ç¥½Ã°¡ ºÙÀº ¸ð¾çÀÌ´Ù.(hostname%) |
Korn Shell |
AT&T º§¿¬±¸¼ÒÀÇ µ¥À̺ñµå ÄÜ(David Korn)ÀÌ °³¹ßÇß´Ù. Bourne ShellÀÇ ±â´É¿¡ C ShellÀÇ ¸î¸î À¯¿ëÇÑ ±â´ÉÀ» Ãß°¡ÇÑ °ÍÀÌ´Ù. Bourne Shell·Î ÀÛ¼ºµÈ ½ºÅ©¸³Æ®¿Í ÇÁ·Î±×·¥Àº Korn Shell¿¡¼ ¹Ù·Î »ç¿ëÇÒ ¼ö ÀÖ´Ù. ÀÏ¹Ý »ç¿ëÀÚÀÇ ±âº» ÇÁ·ÒÇÁÆ®´Â $ ¸ð¾çÀÌ´Ù. |
BASH (GNU Bourne-Again Shell) |
FreeSoftwareFoundationÀÌ °³¹ßÇÑ bash(BSD)´Â C ShellÀ̳ª Korn Shell¿¡ Ãß°¡µÈ À¯¿ëÇÑ Æ¯¼ºÀ» Bourne Shell¿¡ Ãß°¡ÇÏ¿© °³¼±½ÃŲ ¼ÐÀÌ´Ù. |
TC Shell |
ÄÚ³Ú ´ëÇп¡¼ C Shell ¼öÁ¤º»¿¡ Korn ShellÀÇ ±â´ÉÀ» Æ÷ÇÔÇÏ¿© °³¹ßµÈ ¼ÐÀÌ´Ù. 95%ÀÇ C Shell°ú 5%ÀÇ »õ·Î¿î ±â´ÉÀÌ Ãß°¡µÇ¾î ¸¸µé¾îÁ³´Ù. |
Z Shell |
Korn Shell°ú ¸Å¿ì À¯»çÇÑ ¼ÐÀÌÁö¸¸ Korn Shellº¸´Ù ´õ ¸¹°í À¯¿ëÇÑ ±â´É µîÀ» Ãß°¡ÇÏ¿© °³¼±½ÃŲ °ÍÀÌ´Ù. |
|
2. °¢ shell ÀÌ ÂüÁ¶ÇÏ´Â ÆÄÀϵéÀ» ³ª¿ÇÏ°í Á¢±Ù ¼ø¼ Á¤¸® |
- ÂüÁ¶ÇÏ´Â ÆÄÀϵé
½© À̸§ |
¸í·É¾î |
ÂüÁ¶ ÆÄÀÏ |
Bourne Shell |
sh |
.profile |
C Shell |
csh |
.cshrc .login |
Korn Shell |
ksh |
.profile .kshrc |
Bourne Again Shell |
bash |
.bash_profile .bashrc |
|
- Á¢±Ù ¼ø¼
½© À̸§ |
Á¢±Ù ¼ø¼ |
sh |
1) /etc/profile --> 2) $HOME/.profile |
ksh |
1) /etc/profile --> 2) $HOME/.profile -->3) $HOME/.kshrc
¿©±â¼ .kshrc °¡ Á¦´ë·Î µ¿ÀÛ Çϱâ À§Çؼ´Â ¸¸µå½Ã $HOME/.profile ¾È¿¡ export ENV=.kshrc ¶ó°í ¼³Á¤ÀÌ µÇ¾î ÀÖ¾î¾ß¸¸µÊ. |
csh |
1) /etc/.login --> 2) $HOME/.cshrc --> 3) $HOME/.login |
zsh |
1) /etc/zshenv --> 2) /etc/zprofile --> 3) /etc/zshrc --> 4) /etc/zlogin --> 5) $HOME/.zshenv --> 6) $HOME/.zprofile --> 7) $HOME/.zlogin --> $HOME/.zshrc |
bash |
1) /etc/profile --> 2) $HOME/.bash_profile --> 3) $HOME/.bash_login --> 4) $HOME/.profile --> 5) $HOME/.bashrc |
tch |
1) /etc/csh.cshrc --> 2) /etc/csh.login --> 3) $HOME/.tcshrc --> 4) $HOME/.cshrc --> 5) $HOME/.login --> 6) $HOME/.tcshrc ¶Ç´Â $HOME/.cshrc |
|
3. bash, csh¿¡¼ ÇÁ·ÒÇÁÆ®¸¦ ¹Ù²Ù´Â ½Ç½ÀÀ» ÁøÇàÇÏ°í ½Ç½ÀÇÑ ³»¿ëÀ» 2°¡ÁöÀÌ»ó ³ª¿ |
- Korn Shell
$vi .profile
PATH=$PATH:/usr/bin:/usr/bin:/usr/local/bin:.
alias ls='ls -IF'
PS1=PS1="[|u@|h ||]||$"
export PS1 PATH
- C Shell
$vi .cshrc
set path=(/usr/bin /bin/usr/ucb/usr/local/bin .)
set history=30
alias a alias
a ls 'ls -aF'
a setprompt 'set prompt="[$USER@'hostname' 'pwd']"$'
setprompt
- Bash Shell
#vi .bashrc
stty istrip
PATH=/usr/bin:/usr/sfw/bin:/usr/local/bin:/usr/sbin:/usr/ucb:/etc:.
export PATH
TERM=ansi
PS1="[\u@\h\w]$ "; export PS1
set +o allexport
stty erase ^H
stty -istrip cs8
alias ls='ls -pF'
|
4. shell ȯ°æº¯¼ö È®ÀÎÇϱâ |
- bash ȯ°æº¯¼ö ¼³¸í
BASH : »ç¿ëµÇ°í ÀÖ´Â bash ½©ÀÇ Á¾·ù
BASH_VERSION : bash ½©ÀÇ ¹öÀü
COLUMNS : Å͹̳ÎÀÇ Çà¼ö
ENV : ȯ°æ ÁöÁ¤ ÆÄÀÏ(.bashrc_profile)ÀÇ À§Ä¡
HISTFILE : È÷½ºÅ丮 ÆÄÀÏÀÇ °æ·Î
HISTFILESIZE : È÷½ºÅ丮 ÆÄÀÏÀÇ Å©±â
HISTSIZE : È÷½ºÅ丮 °¹¼ö
HOME : ±âº» ÀÛ¾÷ ¿µ¿ª
HOSTNAME : È£½ºÆ® À̸§
LINES : Å͹̳ÎÀÇ ¶óÀμö
LOGNAME : »ç¿ëÀÚ À̸§
LS_COLORS : ÆÄÀÏ Á¾·ùº°·Î »ö»ó ÁöÁ¤
MAIL : ¸ÞÀÏ º¸°ü °æ·Î
MAILCHECK : ¸ÞÀÏ È®ÀÎ ½Ã°£
MANPATH : ¸Å´º¾ó °æ·Î
OSTYPE : ¿î¿µÃ¼Á¦ ŸÀÔ
PATH : ½ÇÇà ÆÄÀÏÀÇ °Ë»ö °æ·Î
PWD : ÇöÀç À§Ä¡
SHELL : ½©ÀÇ °æ·Î
SHLVL : ½©ÀÇ ·¹º§
TERM : Å͹̳ΠÁ¾·ù
USER : »ç¿ëÀÚ
USERNAME : »ç¿ëÀÚ À̸§ |