질문과 답변

Extra Form

가끔 스크립트 중에 일부에서 발견되곤하는데 뭐하는 건지를 알 수가 없네요.

Comment '2'
  • ?
    Alkaid 2010.10.08 16:45

    외부명령을 실행하는 것 같습니다.  일단 ruby-doc.org에 있는 설명을 보면:


    exec(command [, arg, ...])
    Replaces the current process by running the given external command. If exec is given a single argument, that argument is taken as a line that is subject to shell expansion before being executed. If multiple arguments are given, the second and subsequent arguments are passed as parameters to command with no shell expansion. If the first argument is a two-element array, the first element is the command to be executed, and the second argument is used as the argv[0] value, which may show up in process listings. In MSDOS environments, the command is executed in a subshell; otherwise, one of the exec(2) system calls is used, so the running command may inherit some of the environment of the original program (including open file descriptors).

    exec "echo *" # echoes list of files in current directory
    # never get here

    exec "echo", "*" # echoes an asterisk
    # never get here

  • ?
    녹색주머니 2010.10.08 19:23

    감사합니다...

     

    영어는 쥐약이므로 열심히 공부해야겠네요.


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12391
Board Pagination Prev 1 ... 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 Next
/ 82