¿ù°£ Àα⠰Խù°

°Ô½Ã¹° 56°Ç
   
basename °ú dirname
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2011-02-24 (¸ñ) 09:39 Á¶È¸ : 9811
±ÛÁÖ¼Ò :
                          

basename --help
 Usage: basename NAME [SUFFIX]
  or:  basename OPTION
Print NAME with any leading directory components removed.
If specified, also remove a trailing SUFFIX.
 
      --help     ÀÌ µµ¿ò¸»À» Ç¥½ÃÇÏ°í ³¡³À´Ï´Ù
      --version  ¹öÀü Á¤º¸¸¦ Ãâ·ÂÇÏ°í ³¡³À´Ï´Ù
 
Examples:
  basename /usr/bin/sort       Output "sort".
  basename include/stdio.h .h  Output "stdio".
 
ÆÄÀÏ¸í¿¡¼­ °æ·Î Á¤º¸¸¦ ¶¼¾î³»°í ¿ÀÁ÷ ÆÄÀÏ À̸§¸¸ º¸¿© ÁÝ´Ï´Ù. basename $0 À̶ó°í ÇÏ¸é ½ºÅ©¸³Æ®´Â ÀڱⰡ ½©¿¡¼­ ºÒ¸° ÀÚ±â À̸§À» ¾Ë ¼ö ÀÖ½À´Ï´Ù. ½ºÅ©¸³Æ®¿¡ ÇÊ¿äÇÑ ÀÎÀÚ°¡ ¾øÀÌ ½ÇÇàµÇ´Â °æ¿ì¿¡ "»ç¿ë¹ý" ¸Þ¼¼Áö¸¦ ÂïÀ» ¶§ ¾µ ¼ö ÀÖ½À´Ï´Ù. 
 
 
dirname --help
 Usage: dirname NAME
  or:  dirname OPTION
Print NAME with its trailing /component removed; if NAME contains no /'s,
output `.' (meaning the current directory).
 
      --help     ÀÌ µµ¿ò¸»À» Ç¥½ÃÇÏ°í ³¡³À´Ï´Ù
      --version  ¹öÀü Á¤º¸¸¦ Ãâ·ÂÇÏ°í ³¡³À´Ï´Ù
 
Examples:
  dirname /usr/bin/sort  Output "/usr/bin".
  dirname stdio.h        Output ".".
 
ÆÄÀÏ¸í¿¡¼­ basenameÀ» ¶¼¾î³»°í ¿ÀÁ÷ °æ·Î Á¤º¸¸¸ º¸¿©ÁÝ´Ï´Ù.
Âü°í: basename°ú dirnameÀº ¾î¶² ¹®ÀÚ¿­¿¡ ´ëÇؼ­µµ µ¿ÀÛÇÕ´Ï´Ù. ÀÌ ¸í·É¾îµé¿¡ ³Ñ°ÜÁÙ ÀÎÀÚ´Â ²À ½ÇÁ¦·Î Á¸ÀçÇÏ´Â ÆÄÀÏÀÌ ¾Æ´Ï¿©µµ µË´Ï´Ù
 
ex)
#!/bin/bash
tmp=/usr/local/src/httpd-2.2.11.tar.gz
echo "basename = `basename $a`"
echo "dirname = `dirname $a`"
exit 0
 
 
 
### ½ÇÇà°á°ú ###
basename = httpd-2.2.11.tar.gz
dirname = /usr/local/src
 
 
 

À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.