티스토리 뷰
Shell Patterns 과 Reg. Exp는 엄연히 다르다.
UNIX shell의 vi 편집기능, grep, more 등에서는 Reg Exp가 사용되지만 shell에서의 file name generation, case 키워드 등에서는 Shell Patterns을 사용한다. shell의 기능이므로 man sh-posix (쉘 메뉴얼페이지, 다른 쉘을 사용한다면 다를 수 있다.) 에서 File Name Generation 메뉴를 확인할 수 있다. 메뉴얼 페이지에서 /File Name Generation/ Reg Exp를 사용해서 검색할 수 있다.
Basic Patterns (Expressions)
* : Zero or more characters // leading dot string 제외, 즉 hidden file 을 피하게 생성된다.
? : Exactly one character
[abc] : Exactly one character from the group == @(a|b|c)
[a-z] : ASCII character from a to z
[a-d]* : starts with a letter in the range a to d, followed by any number of additional characters
mod??.dir : begins with mod, followed by two characters, then dot dir
mod*0[1-9] :
More Complex Patterns
*(expr) : Zero or more occurrences of expr // *(ab) = { 0, ab, abab, ababab, abababab ... }
+(expr) : one or more occurrences of expr // +(ab) = {ab, abab, ababab, ... }
?(expr) : Zero or one occurence of expr // ?(ab) = { 0, ab }
@(expr) : Exactly one occurence..
!(expr) : Anything else except expr
Pattern Combinations
@(mod|exe)* : Beginning with mod or exe
+(mod)* : One or more occurrences beginning with mod
+([0-9]) : One or more digits any positive integer
?([0-0]) : Zero or one occurrence of a digit
!(no) : Anything except no
@(y|Y)* : Anything that starts with y or Y
@(y|Y)?(e|E)?(s|S) = {y, Y, ye, yE, Ye, YE, yes, ... }, Painful way to spell yes
Review
@(rick|darren|steve) = { rick, darren, steve }
*(rick|darren|steve) = { null, rick, darren, steve, rickrick, darrendarren, stevesteve, rickrickrick... }
+(rick|darren|steve) = { rick, rickrick, ... } // same with *(pattern) except null
!(rick|darren|steve) = anything else except pattern rick and darren, steve
*@([0-9]) : match anystring ending with exactly one digit
'IoT 과정' 카테고리의 다른 글
Array Variable (0) | 2017.07.07 |
---|---|
Program Loops (0) | 2017.07.07 |
Branches and Logic Testing (0) | 2017.07.06 |
Shell Arithmetic (0) | 2017.07.06 |
Designing Program Output (0) | 2017.07.06 |
- Total
- Today
- Yesterday
- 아레나시뮬레이션
- beginning javascript
- 데이터 중심 애플리케이션 설계
- 아레나
- 자바스크립트
- 자바스크립트 예제
- rosen
- 엄청난 인내심과 시뮬레이션을 위한 아레나 툴
- paul wilton
- flutter
- 로젠
- 명제논리
- Arena
- 대규모 시스템 설계 기초
- 백준
- Propositional and Predicate Logic
- Simulation
- 시뮬레이션
- arena simulation
- 이산 수학
- 이산수학
- 그라파나
- 최단경로 알고리즘
- 항해99
- 가상 면접 사례로 배우는 대규모 시스템 설계 기초
- Discrete Mathematics
- javascript
- 아레나 시뮬레이션
- grafana cloud
- Grafana
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |