다. 유닉스 쉘은 역따옴표로 둘러싸인 명령어에 대한 명령어 대체를 지원하는데, 이러한 기능을
활용하여 다음과 같이 출력 경로를 날짜 기준으로 설정할 수 있다.
%
pig
-
param input
=
/
user
/
tom
/
input
/
ncdc
/
micro
-
tab
/
sample
.
txt
\
>
-
param output
=
/
tmp
/`
date
"+%
Y
-
%
m
-
%
d
"`/
out
\
>
ch16
-
pig
/
src
/
main
/
pig
/
max
_
temp
_
param
.
pig
피그는 매개변수 파일에서도 역따옴표로 둘러싸인 명령어를 쉘에서 실행할 때 그 출력 결과를
대체값으로 사용할 수 있도록 해준다. 명령어나 스크립트가
0
이 아닌 최종 상태를 가지면 에러
메시지가 출력되면서 동작을 멈춘다. 매개변수 파일에서의 역따옴표 지원은 유용한 기능이다.
이는 매개변수가 파일 또는 명령행에서 같은 방식으로 정의될 수 있다는 것을 의미한다.
매개변수 대체 처리
매개변수 대체는 스크립트를 실행하기 전에 일어나는 작업이다. 피그를
-
dryrun
옵션과 함께
실행하면 전처리기의 대체 동작을 확인할 수 있다.
dry
run
모드에서 피그는 매개변수 대체(매
크로 확장 포함)를 수행하여 원본 스크립트에서 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.
O’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
I wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
I’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
I'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.