Skip to content

Commit 9dbdc5e

Browse files
ko/book 폴더의 나머지 마크다운 파일을 한국어로 번역하겠습니다.
1 parent b512673 commit 9dbdc5e

File tree

6 files changed

+336
-349
lines changed

6 files changed

+336
-349
lines changed

ko/book/special_variables.md

Lines changed: 63 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,92 @@
11
---
22
next:
3-
text: Programming in Nu
3+
text: Nu로 프로그래밍하기
44
link: /book/programming_in_nu.md
55
---
6-
# Special Variables
6+
# 특수 변수
77

8-
Nushell makes available and uses a number of special variables and constants. Many of these are mentioned or documented in other places in this Book, but this page
9-
should include _all_ variables for reference.
8+
누셸은 여러 특수 변수와 상수를 사용 가능하게 하고 사용합니다. 이들 중 다수는 이 책의 다른 곳에서 언급되거나 문서화되어 있지만, 이 페이지는 참조를 위해 _모든_ 변수를 포함해야 합니다.
109

1110
[[toc]]
1211

1312
## `$nu`
1413

15-
The `$nu` constant is a record containing several useful values:
16-
17-
- `default-config-dir`: The directory where the configuration files are stored and read.
18-
- `config-path`: The path of the main Nushell config file, normally `config.nu` in the config directory.
19-
- `env-path`: The optional environment config file, normally `env.nu` in the config directory.
20-
- `history-path`: The text or SQLite file storing the command history.
21-
- `loginshell-path`: The optional config file which runs for login shells, normally `login.nu` in the config directory.
22-
- `plugin-path`: The plugin registry file, normally `plugin.msgpackz` in the config directory.
23-
- `home-path`: The user's home directory which can be accessed using the shorthand `~`.
24-
- `data-dir`: The data directory for Nushell, which includes the `./vendor/autoload` directories loaded at startup and other user data.
25-
- `cache-dir`: A directory for non-essential (cached) data.
26-
- `vendor-autoload-dirs`: A list of directories where third-party applications should install configuration files that will be auto-loaded during startup.
27-
- `user-autoload-dirs`: A list of directories where the user may create additional configuration files which will be auto-loaded during startup.
28-
- `temp-path`: A path for temporary files that should be writeable by the user.
29-
- `pid`: The PID of the currently running Nushell process.
30-
- `os-info`: Information about the host operating system.
31-
- `startup-time`: The amount of time (in duration) that it took for Nushell to start and process all configuration files.
32-
- `is-interactive`: A boolean indicating whether Nushell was started as an interactive shell (`true`) or is running a script or command-string. For example:
14+
`$nu` 상수는 여러 유용한 값을 포함하는 레코드입니다.
15+
16+
- `default-config-dir`: 구성 파일이 저장되고 읽히는 디렉터리.
17+
- `config-path`: 주 누셸 구성 파일의 경로, 일반적으로 구성 디렉터리의 `config.nu`입니다.
18+
- `env-path`: 선택적 환경 구성 파일, 일반적으로 구성 디렉터리의 `env.nu`입니다.
19+
- `history-path`: 명령 기록을 저장하는 텍스트 또는 SQLite 파일.
20+
- `loginshell-path`: 로그인 셸에 대해 실행되는 선택적 구성 파일, 일반적으로 구성 디렉터리의 `login.nu`입니다.
21+
- `plugin-path`: 플러그인 레지스트리 파일, 일반적으로 구성 디렉터리의 `plugin.msgpackz`입니다.
22+
- `home-path`: 약어 `~`를 사용하여 액세스할 수 있는 사용자의 홈 디렉터리.
23+
- `data-dir`: 시작 시 로드되는 `./vendor/autoload` 디렉터리 및 기타 사용자 데이터를 포함하는 누셸의 데이터 디렉터리.
24+
- `cache-dir`: 필수적이지 않은(캐시된) 데이터용 디렉터리.
25+
- `vendor-autoload-dirs`: 시작 시 자동으로 로드될 구성 파일을 타사 응용 프로그램이 설치해야 하는 디렉터리 목록입니다.
26+
- `user-autoload-dirs`: 사용자가 시작 시 자동으로 로드될 추가 구성 파일을 만들 수 있는 디렉터리 목록입니다.
27+
- `temp-path`: 사용자가 쓸 수 있어야 하는 임시 파일 경로.
28+
- `pid`: 현재 실행 중인 누셸 프로세스의 PID.
29+
- `os-info`: 호스트 운영 체제에 대한 정보.
30+
- `startup-time`: 누셸이 시작되고 모든 구성 파일을 처리하는 데 걸린 시간(기간).
31+
- `is-interactive`: 누셸이 대화형 셸로 시작되었는지(`true`) 또는 스크립트나 명령 문자열을 실행 중인지 여부를 나타내는 부울입니다. 예시:
3332

3433
```nu
3534
$nu.is-interactive
3635
# => true
3736
nu -c "$nu.is-interactive"
3837
# => false
3938
40-
# Force interactive with --interactive (-i)
39+
# --interactive(-i)로 대화형 강제 실행
4140
nu -i -c "$nu.is-interactive"
4241
# => true
4342
```
4443

45-
Note: When started as an interactive shell, startup config files are processed. When started as a non-interactive shell, no config files are read unless explicitly called via flag.
44+
참고: 대화형 셸로 시작하면 시작 구성 파일이 처리됩니다. 비대화형 셸로 시작하면 플래그를 통해 명시적으로 호출되지 않는 한 구성 파일이 읽히지 않습니다.
4645

47-
- `is-login`: Indicates whether or not Nushell was started as a login shell.
48-
- `history-enabled`: History may be disabled via `nu --no-history`, in which case this constant will be `false`.
49-
- `current-exe`: The full path to the currently-running `nu` binary. Can be combined with `path dirname` (which is constant) to determine the directory where the binary is located.
46+
- `is-login`: 누셸이 로그인 셸로 시작되었는지 여부를 나타냅니다.
47+
- `history-enabled`: `nu --no-history`를 통해 기록을 비활성화할 수 있으며, 이 경우 이 상수는 `false`가 됩니다.
48+
- `current-exe`: 현재 실행 중인 `nu` 바이너리의 전체 경로입니다. 바이너리가 있는 디렉터리를 확인하기 위해 `path dirname`(상수)과 결합할 수 있습니다.
5049

5150
## `$env`
5251

53-
`$env` is a special mutable variable containing the current environment variables. As with any process, the initial environment is inherited from the parent process which started `nu`.
52+
`$env`는 현재 환경 변수를 포함하는 특수 가변 변수입니다. 모든 프로세스와 마찬가지로 초기 환경은 `nu`를 시작한 부모 프로세스에서 상속됩니다.
5453

55-
There are also several environment variables that Nushell uses for specific purposes:
54+
누셸이 특정 목적으로 사용하는 몇 가지 환경 변수도 있습니다.
5655

5756
### `$env.CMD_DURATION_MS`
5857

59-
The amount of time in milliseconds that the previous command took to run.
58+
이전 명령이 실행되는 데 걸린 시간(밀리초).
6059

6160
### `$env.config`
6261

63-
`$env.config` is the main configuration record used in Nushell. Settings are documented in `config nu --doc`.
62+
`$env.config`는 누셸에서 사용되는 주 구성 레코드입니다. 설정은 `config nu --doc`에 문서화되어 있습니다.
6463

6564
### `$env.CURRENT_FILE`
6665

67-
Inside a script, module, or sourced-file, this variable holds the fully-qualified filename. Note that this
68-
information is also available as a constant through the [`path self`](/commands/docs/path_self.md) command.
66+
스크립트, 모듈 또는 소싱된 파일 내에서 이 변수는 정규화된 파일 이름을 보유합니다. 이 정보는 [`path self`](/commands/docs/path_self.md) 명령을 통해 상수로도 사용할 수 있습니다.
6967

7068
### `$env.ENV_CONVERSIONS`
7169

72-
Allows users to specify how to convert certain environment variables to Nushell types. See [ENV_CONVERSIONS](./configuration.md#env-conversions).
70+
사용자가 특정 환경 변수를 누셸 유형으로 변환하는 방법을 지정할 수 있습니다. [ENV_CONVERSIONS](./configuration.md#env-conversions)를 참조하십시오.
7371

7472
### `$env.FILE_PWD`
7573

76-
Inside a script, module, or sourced-file, this variable holds the fully qualified name of the directory in which
77-
the file resides. Note that this value is also available as a constant through:
74+
스크립트, 모듈 또는 소싱된 파일 내에서 이 변수는 파일이 있는 디렉터리의 정규화된 이름을 보유합니다. 이 값은 다음을 통해 상수로도 사용할 수 있습니다.
7875

7976
```nu
8077
path self | path dirname
8178
```
8279

8380
### `$env.LAST_EXIT_CODE`
8481

85-
The exit code of the last command, usually used for external commands — Equivalent to `$?` from POSIX. Note that this information is also made available to the `catch` block in a `try` expression for external commands. For instance:
82+
마지막 명령의 종료 코드, 일반적으로 외부 명령에 사용됩니다. POSIX의 `$?`와 동일합니다. 이 정보는 외부 명령에 대한 `try` 표현식의 `catch` 블록에서도 사용할 수 있습니다. 예시:
8683

8784
```nu
8885
^ls file-that-does-not-exist e> /dev/null
8986
$env.LAST_EXIT_CODE
9087
# => 2
9188
92-
# or
89+
# 또는
9390
try {
9491
^ls file-that-does-not-exist e> /dev/null
9592
} catch {|e|
@@ -100,15 +97,15 @@ try {
10097

10198
### `$env.NU_LIB_DIRS`
10299

103-
A list of directories which will be searched when using the `source`, `use`, or `overlay use` commands. See also:
100+
`source`, `use` 또는 `overlay use` 명령을 사용할 때 검색할 디렉터리 목록입니다. 참조:
104101

105-
- The `$NU_LIB_DIRS` constant below
106-
- [Module Path](./modules/using_modules.md#module-path)
107-
- [Configuration - `$NU_LIB_DIRS`](./configuration.md#nu-lib-dirs-constant)
102+
- 아래 `$NU_LIB_DIRS` 상수
103+
- [모듈 경로](./modules/using_modules.md#module-path)
104+
- [구성 - `$NU_LIB_DIRS`](./configuration.md#nu-lib-dirs-constant)
108105

109106
### `$env.NU_LOG_LEVEL`
110107

111-
The [standard library](/book/standard_library.md) offers logging in `std/log`. The `NU_LOG_LEVEL` environment variable is used to define the log level being used for custom commands, modules, and scripts.
108+
[표준 라이브러리](/book/standard_library.md)`std/log`에서 로깅을 제공합니다. `NU_LOG_LEVEL` 환경 변수는 사용자 지정 명령, 모듈 및 스크립트에 사용되는 로그 수준을 정의하는 데 사용됩니다.
112109

113110
```nu
114111
nu -c '1 | print; use std/log; log debug 1111; 9 | print'
@@ -126,77 +123,75 @@ nu -c '1 | print; use std/log; $env.NU_LOG_LEVEL = "debug"; log debug 1111; 9 |
126123
# => 9
127124
```
128125

129-
Note that `$env.NU_LOG_LEVEL` is different from `nu --log-level`, which sets the log level for built-in native Rust Nushell commands. It does not influence the `std/log` logging used in custom commands and scripts.
126+
`$env.NU_LOG_LEVEL`은 기본 제공 네이티브 Rust 누셸 명령의 로그 수준을 설정하는 `nu --log-level`과 다릅니다. 사용자 지정 명령 및 스크립트에서 사용되는 `std/log` 로깅에 영향을 미치지 않습니다.
130127

131128
```nu
132129
nu --log-level 'debug' -c '1 | print; use std/log; log debug 1111; 9 | print'
133-
# => … a lot more log messages, with references to the Nushell command Rust source files
134-
# and without our own `log debug` message
130+
# => … 훨씬 더 많은 로그 메시지, 누셸 명령 Rust 소스 파일에 대한 참조 포함
131+
# 그리고 우리 자신의 `log debug` 메시지 없이
135132
# => 1
136133
# => 9
137134
# => …
138135
```
139136

140137
### `$env.NU_PLUGIN_DIRS`
141138

142-
A list of directories which will be searched when registering plugins with `plugin add`. See also:
139+
`plugin add`로 플러그인을 등록할 때 검색할 디렉터리 목록입니다. 참조:
143140

144-
- [Plugin Search Path](./plugins.md#plugin-search-path)
141+
- [플러그인 검색 경로](./plugins.md#plugin-search-path)
145142

146143
### `$env.NU_VERSION`
147144

148-
The current Nushell version. The same as `(version).version`, but, as an environment variable, it is exported to and can be read by child processes.
145+
현재 누셸 버전입니다. `(version).version`과 동일하지만 환경 변수이므로 자식 프로세스로 내보내지고 읽을 수 있습니다.
149146

150147
### `$env.PATH`
151148

152-
The search path for executing other applications. It is initially inherited from the parent process as a string, but converted to a Nushell `list` at startup for easy access.
149+
다른 응용 프로그램을 실행하기 위한 검색 경로입니다. 처음에는 부모 프로세스에서 문자열로 상속되지만 쉽게 액세스할 수 있도록 시작 시 누셸 `list`로 변환됩니다.
153150

154-
It is converted back to a string before running a child-process.
151+
자식 프로세스를 실행하기 전에 문자열로 다시 변환됩니다.
155152

156153
### `$env.PROCESS_PATH`
157154

158-
When _executing a script_, this variable represents the name and relative path of the script. Unlike the two variables
159-
above, it is not present when sourcing a file or importing a module.
155+
_스크립트를 실행할 때_ 이 변수는 스크립트의 이름과 상대 경로를 나타냅니다. 위의 두 변수와 달리 파일을 소싱하거나 모듈을 가져올 때는 존재하지 않습니다.
160156

161-
Note: Also unlike the two variables above, the exact path (including symlinks) that was used to _invoke_ the file is returned.
157+
참고: 또한 위의 두 변수와 달리 파일을 _호출_하는 데 사용된 정확한 경로(심볼릭 링크 포함)가 반환됩니다.
162158

163-
### `$env.PROMPT_*` and `$env.TRANSIENT_PROMPT_*`
159+
### `$env.PROMPT_*` `$env.TRANSIENT_PROMPT_*`
164160

165-
A number of variables are available for configuring the Nushell prompt that appears on each commandline. See also:
161+
각 명령줄에 나타나는 누셸 프롬프트를 구성하는 데 사용할 수 있는 여러 변수가 있습니다. 참조:
166162

167-
- [Configuration - Prompt Configuration](./configuration.md#prompt-configuration)
163+
- [구성 - 프롬프트 구성](./configuration.md#prompt-configuration)
168164
- `config nu --doc`
169165

170166
### `$env.SHLVL`
171167

172-
`SHLVL` is incremented by most shells when entering a new subshell. It can be used to determine the number of nested shells. For instance,
173-
if `$env.SHLVL == 2` then typing `exit` should return you to a parent shell.
168+
`SHLVL`은 새 하위 셸에 들어갈 때 대부분의 셸에서 증가합니다. 중첩된 셸 수를 확인하는 데 사용할 수 있습니다. 예를 들어, `$env.SHLVL == 2`이면 `exit`를 입력하면 부모 셸로 돌아가야 합니다.
174169

175170
### `$env.XDG_CONFIG_HOME`
176171

177-
Can be used to optionally override the `$nu.default-config-dir` location. See [Configuration - Startup Variables](./configuration.md#startup-variables).
172+
선택적으로 `$nu.default-config-dir` 위치를 재정의하는 데 사용할 수 있습니다. [구성 - 시작 변수](./configuration.md#startup-variables)를 참조하십시오.
178173

179174
### `$env.XDG_DATA_DIR`
180175

181-
Can be used to optionally override the `$nu.data-dir` location. See [Configuration - Startup Variables](./configuration.md#startup-variables).
176+
선택적으로 `$nu.data-dir` 위치를 재정의하는 데 사용할 수 있습니다. [구성 - 시작 변수](./configuration.md#startup-variables)를 참조하십시오.
182177

183178
## `$in`
184179

185-
The `$in` variable represents the pipeline input into an expression. See [Pipelines - The Special `$in` Variable](./pipelines.md#pipeline-input-and-the-special-in-variable).
180+
`$in` 변수는 표현식에 대한 파이프라인 입력을 나타냅니다. [파이프라인 - 특수 `$in` 변수](./pipelines.md#pipeline-input-and-the-special-in-variable)를 참조하십시오.
186181

187182
## `$it`
188183

189-
`$it` is a special variable that is _only_ available in a `where` "row condition" — a convenient shorthand which simplifies field access. See `help where` or [where](/commands/docs/where.md) for more information.
184+
`$it``where` "행 조건"에서만 사용할 수 있는 특수 변수입니다. 필드 액세스를 단순화하는 편리한 약어입니다. 자세한 내용은 `help where` 또는 [where](/commands/docs/where.md)를 참조하십시오.
190185

191186
## `$NU_LIB_DIRS`
192187

193-
A constant version of `$env.NU_LIB_DIRS` - a list of directories which will be searched when using the `source`, `use`, or `overlay use` commands. See also:
188+
`$env.NU_LIB_DIRS`의 상수 버전 - `source`, `use` 또는 `overlay use` 명령을 사용할 때 검색할 디렉터리 목록입니다. 참조:
194189

195-
- [Module Path](./modules/using_modules.md#module-path)
196-
- [Configuration - `$NU_LIB_DIRS`](./configuration.md#nu-lib-dirs-constant)
190+
- [모듈 경로](./modules/using_modules.md#module-path)
191+
- [구성 - `$NU_LIB_DIRS`](./configuration.md#nu-lib-dirs-constant)
197192

198193
## `$NU_PLUGIN_DIRS`
199194

200-
A constant version of `$env.NU_PLUGIN_DIRS` - a list of directories which will be searched when registering plugins with `plugin add`. See also:
195+
`$env.NU_PLUGIN_DIRS`의 상수 버전 - `plugin add`로 플러그인을 등록할 때 검색할 디렉터리 목록입니다. 참조:
201196

202-
- [Plugin Search Path](./plugins.md#plugin-search-path)
197+
- [플러그인 검색 경로](./plugins.md#plugin-search-path)

0 commit comments

Comments
 (0)