2019년 11월 6일 수요일

linux 명령 시, pipe, redirection 사용

1번 방법 : 괄호 사용
     (./bermuda | ./geo2json) < spooky.csv > output.json

2번 방법 : 괄호 미사용
     ./bermuda < spooky.csv | ./geo2json > output.json


Head First C 의 pdf 135 페이지에 설명됨.

< : Standard Input 을 키보드가 아닌 입력 파일(spooky.csv)와 연결시킴

> : Standard Ouput 을 출력장치(monitor)가 아닌 output.json 와 연결시킴.


| : 이 기호는 pipe를 생성시키고,
    앞 쪽 process 의 Standard Output 을 뒤 쪽 process 의
    Standard Input 으로 연결해 줌.

The | symbol is a pipe that connects the Standard Output of one process to the
Standard Input of another process.

Head First C 의 pdf 131 페이지에 설명됨.

댓글 없음:

댓글 쓰기

팔로어