티스토리 뷰
반응형
Process
+----- file descriptor table { 0, 1, 2, .... } 0 표준 입력, 1 표준 출력, 2 표준 에러, 3~9까지 범용으로 쓰일 수 있다. 10은 평범한 방법으로 못 쓴다.
+----- file table { tty , ... } tty는 0, 1, 2 에 의해 가리켜진다.
Managing Input/Output
Redirection of input : cmd < data_file mail user13 < mail.txt
Redirection of output : cmd > data_file
Redirection of input text : cmd << end_file_marker
$ mail user13 << XXX // XXX, here, EOF 등등 쓸 수 있다.
> hello - my name is ...
> I hereby ...
> I ...
> ..
> ...
> I need
> XXX
Piping of output : cmd | next_command
Redirection of errors : cmd 2> error_file
Run in background : cmd &
Run in background : cmd &
sh // $ls -al 수행시
+ // fork() 수행, child shell 생성
+-----------+
parent child
shell shell exec() /usr/bin/ls
+----------+-------------+
+----------+-------------+
wait()------+ // child shell exit 수행, parent shell 은 wait() 수행, 그 뒤 원래 쉘에 프롬포트 $가 뜬다.
$ exec ls -al // 이것을 하면 fork 수행을 안하므로, 본 쉘은 명령어 수행후 마치 child shell 이 exit하 듯이 터미널은 종료된다.
Data-Flow File Descriptor 3-9
Open file for reading : exec [3-9]< data_file
Open file for write/overwrite : exec [3-9]> data_file
Open file for write/append : exec [3-9]>> data_file
Redirection of output : command >&[3-9]
Open file for write/overwrite : exec [3-9]> data_file
Open file for write/append : exec [3-9]>> data_file
Redirection of output : command >&[3-9]
Close input file descriptor : exec [3-9]<&-
Close output file descriptor : exec [3-9]>&-
print text_file | while read var
while read var ... done < text_file
반응형
'IoT 과정' 카테고리의 다른 글
LINUX KERNEL & DEVICES (0) | 2017.07.17 |
---|---|
Enterprise Linux System - Adnministration 시작 (0) | 2017.07.17 |
Functions and Function Libraries (0) | 2017.07.07 |
Array Variable (0) | 2017.07.07 |
Program Loops (0) | 2017.07.07 |
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- Grafana
- 아레나
- 백준
- 명제논리
- 가상 면접 사례로 배우는 대규모 시스템 설계 기초
- beginning javascript
- 엄청난 인내심과 시뮬레이션을 위한 아레나 툴
- javascript
- grafana cloud
- 로젠
- 자바스크립트
- 대규모 시스템 설계 기초
- 데이터 중심 애플리케이션 설계
- paul wilton
- Simulation
- 항해99
- arena simulation
- 그라파나
- 이산수학
- rosen
- 아레나시뮬레이션
- 아레나 시뮬레이션
- 이산 수학
- flutter
- 자바스크립트 예제
- 최단경로 알고리즘
- Propositional and Predicate Logic
- Discrete Mathematics
- Arena
- 시뮬레이션
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함