컴퓨터 엑셀 워드 포토샵 구글어스 WINDOWS JAVASCRIPT JAVA C++

 
Friday, September 01, 2006

리눅스/Cygwin] echo (에코) 명령의 용도 / 도움말 출력하기


echo 는, 문자열을 화면에 출력하는 단순한 명령입니다. bash 쉘에서 직접 쓰이지는 않고 스크립트 안에서 사용됩니다.

echo 'ABCD'

라고 하면

ABCD 라는 글자가 화면에 찍힙니다.


-e 옵션을 붙여 주면, 다음과 같이 "이스케이프 문자"도 사용할 수 있습니다.
 $ echo -e 'ABCD\nEFGH'
ABCD
EFGH

이렇게 개행문자(\n) 도 입력 가능합니다.



그런데 Cygwin(시그윈)에서는

echo --help

라고 하면 도움말이 나오지 않고, 그냥 --help 라는 문자열이 화면에 출력됩니다. echo 명령의 도움말을 보기 위해서는

man echo

라고 하면 매뉴얼 페이지에서 다음과 같은 도움말을 얻을 수 있습니다:

ECHO(1)                          User Commands                         ECHO(1)

NAME
       echo - display a line of text

SYNOPSIS
       echo [OPTION]... [STRING]...

DESCRIPTION
       Echo the STRING(s) to standard output.

       -n     do not output the trailing newline

       -e     enable interpretation of backslash escapes

       -E     disable interpretation of backslash escapes (default)

       --help display this help and exit

       --version
              output version information and exit

       If -e is in effect, the following sequences are recognized:

       \0NNN  the character whose ASCII code is NNN (octal)

       \\     backslash

       \a     alert (BEL)

       \b     backspace

       \c     suppress trailing newline

       \f     form feed

       \n     new line

       \r     carriage return

       \t     horizontal tab

       \v     vertical tab

       NOTE: your shell may have its own version of echo, which usually super-
       sedes the version described here.  Please refer to your  shell's  docu-
       mentation for details about the options it supports.

AUTHOR
       Written by FIXME unknown.

REPORTING BUGS
       Report bugs to <bug-coreutils@gnu.org>.

COPYRIGHT
       Copyright (C) 2006 Free Software Foundation, Inc.
       This  is  free  software.   You may redistribute copies of it under the
       terms      of      the      GNU      General       Public       License
       <http://www.gnu.org/licenses/gpl.html>.   There  is NO WARRANTY, to the
       extent permitted by law.

SEE ALSO
       The full documentation for echo is maintained as a Texinfo manual.   If
       the  info  and  echo  programs are properly installed at your site, the
       command

              info echo

       should give you access to the complete manual.

echo 5.97                          May 2006                            ECHO(1)




☞ 리눅스

0 Comments:

Post a Comment

<< Home RSS 2.0 feed

구글 Google 에서 제공하는 무료 블로그 서비스인 블로거 Blogger 의 인터넷 주소는 www.blogger.com 입니다. Blogger 에 블로그를 만들면, blogspot.com 이라는 주소에 블로그가 생성됩니다.
블로그를 직접 방문하지 않고도 최신 게시물을 구독하려면 RSS 2.0 feed 주소를 리더기에 등록하시면 됩니다.
Previous Posts
Monthly Archives
Top