주 메뉴 열기

wwiki β

바뀜

Bash

3,559 바이트 추가됨, 2023년 6월 18일 (일) 05:30
편집 요약 없음
==script syntax==https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html
bash 명령어를 사용하면 bash를 사용할 수 있다. 기본쉘을 변경하려면 chsh -s /bin/bash == 정의(용어) == === POSIX ===Bash는 주로 POSIX 1003.1에서(https://standards.ieee.org/ieee/1003.1/7700/) Shell과 Utilities부분과 관련이 있다. === blank ===공백 또는 탭 문자 === builtin ===실행파일이 아니라 Shell 자체에 내장된 명령이다. === control operator ===control function을 수행하는 토큰이다. ''newline''이거나 ‘||’, ‘&&’, ‘&’, ‘;’, ‘;;’, ‘;&’, ‘;;&’, ‘|’, ‘|&’, ‘(’, or ‘)’ 이다. === exit status ===명령이 caller에게 리턴한 값이다. 8bit이다. (최대값 255) === field ===text의 unit이다. text는 shell expansions의 하나의 결과이다. 명령이 실행되었을 때 expansion 후에 resulting fields는 명령어 이름과 arguments로서 사용된다. === file name ===파일을 식별하는데 사용하는 문자열이다. === job ===동일한 프로세스 그룹에 있는 파이프라인과 파이프라인에서 파생된 모든 프로세스로 구성된 프로세스 집합 === job control ===사용자가 프로세스 실행을 선택적으로 중지(일시 중지) 및 다시 시작(재개)할 수 있는 메커니즘 === metacharacter ===따옴표가 아닌 문자로 단어와 구분된다. metacharacter는 ''space'', ''tab'', ''newline'' 또는 다음 문자 중 하나이다. '|', '&', ';', '(', ')', '<', 또는 '>'. === name ===letters, numbers, underscores로만 이루어진 단어이다. letter나 underscore로 시작한다. name은 쉘 변수와 함수명으로 사용된다. 식별자로 사용되기도 한다. === operator ===control operator 혹은 redirection operator이다. === process group ===같은 process group ID를 가지는 연관된 프로세스들의 묶음이다. === process group ID === === reserved word ===예약어. ''for'', ''while'' 같은 것들이다. === return status ===exit status와 같다. === signal ===시스템에서 발생하는 이벤트를 커널이 프로세스에 알릴 수 있는 메커니즘입니다. === special builtin ===POSIX에 의해 특별 분류된 builtin command. === token ===shell에서 single unit으로 간주되는 문자의 sequence이다. ''word'' 이거나 ''operator''이다. === word ===shell에서 unit으로 취급되는 문자의 sequence이다. 단어들은 따옴표가 없는 metacharacters를 포함할 수 없다. ==Shell Syntax== == Shell Commands == === Reserved Words === === Simple Commands === === Pipelines === === List of Commands === === Compound Commands === ==== Looping Constructs ==== ====Conditional Constructs =if==='''if'''<syntaxhighlight lang="bash">
if [ -z "$1" ] && [ -z "$2" ]
fi
</syntaxhighlight>연산자
<nowiki>==== 연산자 =====</nowiki>
!=
True if the length of <var>string</var> is non-zero.
 
==== Grouping Commands ====
 
=== Coprocesses ===
 
=== GNU Parallel ===
 
== Shell Functions ==
 
== Shell Parameters ==
 
== Shell Expansions ==
 
=== Brace Expansion ===
 
=== Tilde Expansion ===
 
=== Shell Parameter Expansion ===
 
=== 명령 대체(Command Substitution) ===
다음과 같이 사용한다.<syntaxhighlight lang="bash">
$(command)
</syntaxhighlight>or<syntaxhighlight lang="bash">
`command`
</syntaxhighlight>변수에 넣어 출력할 수 있다. 첫번째 라인은 띄어쓰기가 없다.<syntaxhighlight lang="bash">
OUTPUT=$(ls -1)
echo "${OUTPUT}"
</syntaxhighlight>
 
=== Arithmetic Expansion ===
 
=== Process Substitution ===
 
=== Word Splitting ===
 
=== Filename Expansion ===
 
=== Quote Removal ===
 
== Redirections ==
 
== Executing Commands ==
 
== Shell Scripts ==
 
 
 
=== stdout없애기 ===
\": "출력해야 하는 경우
 
==단축키==
매뉴얼: http://www.gnu.org/software/bash/manual/html_node/index.html
[[분류:Linux]]
[[분류:단축키]]
[[분류:리눅스]]
편집
2,431