You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
+
누셸은 여러 특수 변수와 상수를 사용 가능하게 하고 사용합니다. 이들 중 다수는 이 책의 다른 곳에서 언급되거나 문서화되어 있지만, 이 페이지는 참조를 위해 _모든_ 변수를 포함해야 합니다.
10
9
11
10
[[toc]]
12
11
13
12
## `$nu`
14
13
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`) 또는 스크립트나 명령 문자열을 실행 중인지 여부를 나타내는 부울입니다. 예시:
33
32
34
33
```nu
35
34
$nu.is-interactive
36
35
# => true
37
36
nu -c "$nu.is-interactive"
38
37
# => false
39
38
40
-
# Force interactive with --interactive(-i)
39
+
# --interactive(-i)로 대화형 강제 실행
41
40
nu -i -c "$nu.is-interactive"
42
41
# => true
43
42
```
44
43
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
+
참고: 대화형 셸로 시작하면 시작 구성 파일이 처리됩니다. 비대화형 셸로 시작하면 플래그를 통해 명시적으로 호출되지 않는 한 구성 파일이 읽히지 않습니다.
46
45
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`(상수)과 결합할 수 있습니다.
50
49
51
50
## `$env`
52
51
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`를 시작한 부모 프로세스에서 상속됩니다.
54
53
55
-
There are also several environment variables that Nushell uses for specific purposes:
54
+
누셸이 특정 목적으로 사용하는 몇 가지 환경 변수도 있습니다.
56
55
57
56
### `$env.CMD_DURATION_MS`
58
57
59
-
The amount of time in milliseconds that the previous command took to run.
58
+
이전 명령이 실행되는 데 걸린 시간(밀리초).
60
59
61
60
### `$env.config`
62
61
63
-
`$env.config` is the main configuration record used in Nushell. Settings are documented in `config nu --doc`.
62
+
`$env.config`는 누셸에서 사용되는 주 구성 레코드입니다. 설정은 `config nu --doc`에 문서화되어 있습니다.
64
63
65
64
### `$env.CURRENT_FILE`
66
65
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) 명령을 통해 상수로도 사용할 수 있습니다.
69
67
70
68
### `$env.ENV_CONVERSIONS`
71
69
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)를 참조하십시오.
73
71
74
72
### `$env.FILE_PWD`
75
73
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
+
스크립트, 모듈 또는 소싱된 파일 내에서 이 변수는 파일이 있는 디렉터리의 정규화된 이름을 보유합니다. 이 값은 다음을 통해 상수로도 사용할 수 있습니다.
78
75
79
76
```nu
80
77
path self | path dirname
81
78
```
82
79
83
80
### `$env.LAST_EXIT_CODE`
84
81
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` 블록에서도 사용할 수 있습니다. 예시:
86
83
87
84
```nu
88
85
^ls file-that-does-not-exist e> /dev/null
89
86
$env.LAST_EXIT_CODE
90
87
# => 2
91
88
92
-
# or
89
+
# 또는
93
90
try {
94
91
^ls file-that-does-not-exist e> /dev/null
95
92
} catch {|e|
@@ -100,15 +97,15 @@ try {
100
97
101
98
### `$env.NU_LIB_DIRS`
102
99
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`명령을 사용할 때 검색할 디렉터리 목록입니다. 참조:
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`환경 변수는 사용자 지정 명령, 모듈 및 스크립트에 사용되는 로그 수준을 정의하는 데 사용됩니다.
112
109
113
110
```nu
114
111
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 |
126
123
# => 9
127
124
```
128
125
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`로깅에 영향을 미치지 않습니다.
130
127
131
128
```nu
132
129
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` 메시지 없이
135
132
# => 1
136
133
# => 9
137
134
# => …
138
135
```
139
136
140
137
### `$env.NU_PLUGIN_DIRS`
141
138
142
-
A list of directories which will be searched when registering plugins with `plugin add`. See also:
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`과 동일하지만 환경 변수이므로 자식 프로세스로 내보내지고 읽을 수 있습니다.
149
146
150
147
### `$env.PATH`
151
148
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`로 변환됩니다.
153
150
154
-
It is converted back to a string before running a child-process.
151
+
자식 프로세스를 실행하기 전에 문자열로 다시 변환됩니다.
155
152
156
153
### `$env.PROCESS_PATH`
157
154
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
+
_스크립트를 실행할 때_ 이 변수는 스크립트의 이름과 상대 경로를 나타냅니다. 위의 두 변수와 달리 파일을 소싱하거나 모듈을 가져올 때는 존재하지 않습니다.
160
156
161
-
Note: Also unlike the two variables above, the exact path (including symlinks) that was used to _invoke_ the file is returned.
157
+
참고: 또한 위의 두 변수와 달리 파일을 _호출_하는 데 사용된 정확한 경로(심볼릭 링크 포함)가 반환됩니다.
162
158
163
-
### `$env.PROMPT_*`and`$env.TRANSIENT_PROMPT_*`
159
+
### `$env.PROMPT_*`및`$env.TRANSIENT_PROMPT_*`
164
160
165
-
A number of variables are available for configuring the Nushell prompt that appears on each commandline. See also:
161
+
각 명령줄에 나타나는 누셸 프롬프트를 구성하는 데 사용할 수 있는 여러 변수가 있습니다. 참조:
`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`를 입력하면 부모 셸로 돌아가야 합니다.
174
169
175
170
### `$env.XDG_CONFIG_HOME`
176
171
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)를 참조하십시오.
178
173
179
174
### `$env.XDG_DATA_DIR`
180
175
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)를 참조하십시오.
182
177
183
178
## `$in`
184
179
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)를 참조하십시오.
186
181
187
182
## `$it`
188
183
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)를 참조하십시오.
190
185
191
186
## `$NU_LIB_DIRS`
192
187
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`명령을 사용할 때 검색할 디렉터리 목록입니다. 참조:
0 commit comments