<설명>
- 시작부터 끝까지 Process 혹은 Transmit 되는 Data 를 가진 File.
- 차례로 Carried out(수행)되는 OS Command(명령) File.
==> OS는 Command 를 해석하여, CPU가 Execute(실행)하는 기계어로 변환.
- Batch File은 백업 형성 및 Application Launch(실행) 등 일련의 Routine File 관리 작업을 수행하는데 사용됨.
- Batch File은 Win OS 에서 .BAT & .CMD 파일 확장자로 쓰이며, 'Command Script' 라는 공식 명칭이 있음.
==> Unix/Linux OS 에서 .SH 파일 확장자로 쓰이며, 'Shell Script' 라고 불림.
<예시>
- 위키피디아 같은 어떤 백과사전 홈페이지가 있다고 하자.
==> 이 홈페이지에서 월별 버전을 준비할 때 여러 OS Batch File을 사용하여 File 을 Combine(결합) 및 Aggregate(집계)하고, 변환 Program 실행과 함께 배포를 위해 여러 Target Folder에 File을 복사함.
- 대용량의 Database 가 있다고 하자.
==> 매번 사용자가 Query를 직접 날리는건 고생이므로, Procedure에 Query를 넣고 Batch 작업을 걸어 조건에 따라 자동으로 수행되게 함(Scheduling).
<FIle 형식 in Windows PC>
[Batch Command] : xcopy \%1\*.%2 g:\ /m -- Batch 기본 명령어
[User Enters] : C:\>save john gif -- 사용자 입력 명령어
[Executes as] : xcopy \john\*.gif g:\ /m -- OS가 실행하는 명령어
<자주 쓰이는 Command>
cls Clear Screen
rem or :: Remarks
@echo off Turn off display for this command only
echo off Turn off display
echo on Turn on display
echo Display message
call Call other batch file
pause Stop and wait for keystroke
choise Input selection
%1 - %9 Input parameter variables
- 중간에 Batch 작업을 중단하려면 Ctrl + C 누르면 됨.
<참조 1> https://www.pcmag.com/encyclopedia/term/batch-file
<참조 2> https://www.pcmag.com/encyclopedia/term/batch-file-abcs
<참조 3>
'Programing > Knowledge' 카테고리의 다른 글
[Knowledge] Map (맵) 이란 무엇인가? (0) | 2023.04.09 |
---|---|
[CS] Stub (0) | 2022.12.09 |
[CS] Remote Procedure Call (RPC) (0) | 2022.12.08 |
[CS] Mount (0) | 2022.12.07 |
댓글