ksh È°¿ëÇϱâ
ÀÛ¼ºÀÚ °ü¸®ÀÚ ÀÛ¼º½Ã°£ 2003-08-14 11:54:33
 

DOSÀÇ autoexec.bat°ú °°Àº ±â´ÉÀ» ÇÏ´Â ÆÄÀÏÀÌ .profile ÀÌ´Ù.
sh, csh, ksh ¸ðµÎ login½Ã »ç¿ëµÇ´Â shell script ÆÄÀÏÀ» °¡Áö°í ÀÖ´Ù.
sh¿Í ksh´Â .profileÀ» »ç¿ëÇÏ°í csh´Â .cshrc¸¦ »ç¿ëÇÑ´Ù.

.profileÀº DOSÀÇ autoexec.bat°ú °°´Ù°í »ý°¢ÇÏ°í »ç¿ëÇÏ¸é µÈ´Ù. ³»°¡ óÀ½
loginÇÒ¶§ ½ÇÇàµÇµµ·Ï ÇÏ°í ½ÍÀº ÇÁ·Î±×·¥À̳ª ÇÊ¿äÇÑ È¯°æº¯¼öÀÇ ¼±¾ðÀ» ÀÌ°÷¿¡
Àû¾îÁØ´Ù.

1. .profileÀ» ´Ù½Ã ½ÇÇà
ÀÏ´Ü loginÇÑ ÈÄ .profileÀ» ¼öÁ¤ÇÏ¸é ´ÙÀ½¹ø loginºÎÅÍ ¼öÁ¤ÇÑ ³»¿ëÀÌ
Àû¿ëµÈ´Ù. DOSÀÇ °æ¿ì autoexec.batÀ» ´Ù½Ã ½ÇÇà½ÃÄÑÁÖ¸é µÇÁö¸¸ UNIX´Â
±×·¸°Ô µÇÁö ¾Ê´Â´Ù.
À̶§´Â .(Á¡)À» »ç¿ëÇÑ´Ù.
%> . .profile $ .(Á¡) .(Á¡)profile
ÀÌ·¸°Ô Çϸé login½Ã¿¡ ½ÇÇàÇÑ °Í°ú µ¿ÀÏÇÑ È¿°ú¸¦ ¹ßÈÖÇÑ´Ù.
csh¿¡¼­´Â source .cshrc ÇÏ°í ½ÇÇàÇÏ¸é µÈ´Ù.

2. .profile¿¡ ¸¹ÀÌ »ç¿ëµÇ´Â ³»¿ë.
export PS1='$PWD:\!> ' # Prompt ¼³Á¤

set -o vi # kshÀÇ command line¿¡¼­ vi key¸¦ »ç¿ë
EXINIT='ai ts=4' # vi »ç¿ë ȯ°æÀ» ÃʱâÈ­ Çϴ ȯ°æº¯¼ö
stty erase ^H # backspace¸¦ [Del]´ë½Å [<--]·Î º¯°æ
alias ls='ls -aFs' # ls ¸í·É ÀçÁöÁ¤
alias rm='rm -i' # rm ¸í·É ÀçÁöÁ¤
alias cp='cp -i' # cp ¸í·É ÀçÁöÁ¤

stty cs8 -istrip # terminal¿¡¼­ ÇѱÛ󸮰¡ µÇµµ·Ï ÁöÁ¤

export PATH=$PATH:. # current dirÀ» PATH¿¡ ÁöÁ¤

HOMEÀº ÇöÀç »ç¿ëÀÚÀÇ login µð·ºÅ丮¸¦ ÁöÁ¤ÇÏ°í Àִ ȯ°æº¯¼öÀÌ´Ù.
1. ¾Æ·¡´Â HOMEÀ» »ç¿ëÇÏ´Â ¸î°¡Áö ¿¹ÀÌ´Ù.
%> echo $HOME
/home/tradeoff
%> cd $HOME/bin # /home/tradeoff/bin À¸·Î À̵¿
% PATH=$PATH:$HOME/bin # PATH¿¡ ÀڽŸ¸ÀÇ ¸í·ÉÀ» ³Ö¾î µÎ´Â µð·º
Å丮ÀÎ
# /home/tradeoff/bin À» Ãß°¡.


¸ñ·Ï | ÀÔ·Â | ¼öÁ¤ | ´äº¯ | »èÁ¦