티스토리 뷰
.exrc => vi setting
tabstop => tab indentation
shiftwidth => shift movement ( shift move cmd "shift + < or >")
number => line number
/usr/bin/ex hard link with /usr/bin/vi, vi command mode 에서 : 뒤 명령어 wq, q! 등의 command는 ex 의 command 이다.
branch and loop ... UNIX의 keyword
from pre-ALGOL, loop syntax's history starts. ... the begin of Structured Programming Language.
branch single (if), multiple (case)
loop for, while, until
branch and loop ... C는 integer로, java는 boolean, Shell은 return 값으로 결정
test, [ ... ]
...기존에 알던 컴퓨터 언어 때문에 더욱이 헷갈리는 keyword 중 하나다...
test -a file : if file exists, then true
test -d file : if file exists and is a directory, then true
test -f file : if file exists and is an ordinary file, then true
string = patter if string matches patter then true
[ 1 -lt 3 ] : true
[ "$var" = 123 ] .. 변수에 double quoting을 하는 것이 안전하다. 변수값이 null이 있을 경우 안전하다.
$ [ $x -ge 2 -a $x -lt 5 ]
$ echo $?
0
$ [[ $x -ge 2 && $x -lt 5 ]]
$ echo $?
0
$ (( $x >= 2 && $x < 5 ))
$ echo $?
0
then ...
if ...
then ...
else ...
fi
if ...
then ...
elif ...
then ...
fi
if 문을 처음 쓰면서 만나는 것들
:set all { autoindent, autoindent에서 한칸 나오는법 ctrl + d, 또는 들여쓰기 shift + <, >, shift 이동은 set all에서 shiftwidth에서 확인가능. indentation 또는 yank. delete를 효율적이게 이용하는 방법 marking command, 마킹명령어 m"임의의 캐릭터, 26가지의 조합" // 팁은 mm <- 손 접근이 빠르기 때문, 현 위치에서 마킹 m 까지 indentation은 => shift + > + ' + m , 그냥 마킹까지 이동은 => ' + m
case $var in //$var 하는 것을 깜빡하면안된다, var을 넘기면 var 자체로 패턴매칭을하므로 주의
choice_1) ... ;;
choice_2) ... ;;
esac
case ... in
(pattern_1) ... ;;
(pattern_2) ... ;;
(pattern_3|pattern_4) ... ;;
*) ... ;;
esac
'IoT 과정' 카테고리의 다른 글
Program Loops (0) | 2017.07.07 |
---|---|
Shell Patterns (0) | 2017.07.07 |
Shell Arithmetic (0) | 2017.07.06 |
Designing Program Output (0) | 2017.07.06 |
User Input (0) | 2017.07.05 |
- Total
- Today
- Yesterday
- 시뮬레이션
- 이산 수학
- Arena
- 백준
- beginning javascript
- paul wilton
- 엄청난 인내심과 시뮬레이션을 위한 아레나 툴
- arena simulation
- Propositional and Predicate Logic
- 아레나
- 가상 면접 사례로 배우는 대규모 시스템 설계 기초
- 명제논리
- javascript
- 아레나 시뮬레이션
- Grafana
- 데이터 중심 애플리케이션 설계
- rosen
- 그라파나
- 자바스크립트
- Discrete Mathematics
- 자바스크립트 예제
- flutter
- grafana cloud
- 최단경로 알고리즘
- 항해99
- 아레나시뮬레이션
- 로젠
- Simulation
- 이산수학
- 대규모 시스템 설계 기초
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |