Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions book/special_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ next:
text: Programming in Nu
link: /book/programming_in_nu.md
---

# Special Variables

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
Expand All @@ -20,12 +21,12 @@ The `$nu` constant is a record containing several useful values:
- `history-path`: The text or SQLite file storing the command history.
- `loginshell-path`: The optional config file which runs for login shells, normally `login.nu` in the config directory.
- `plugin-path`: The plugin registry file, normally `plugin.msgpackz` in the config directory.
- `home-path`: The user's home directory which can be accessed using the shorthand `~`.
- `home-dir`: The user's home directory which can be accessed using the shorthand `~`.
- `data-dir`: The data directory for Nushell, which includes the `./vendor/autoload` directories loaded at startup and other user data.
- `cache-dir`: A directory for non-essential (cached) data.
- `vendor-autoload-dirs`: A list of directories where third-party applications should install configuration files that will be auto-loaded during startup.
- `user-autoload-dirs`: A list of directories where the user may create additional configuration files which will be auto-loaded during startup.
- `temp-path`: A path for temporary files that should be writeable by the user.
- `temp-dir`: A path for temporary files that should be writeable by the user.
- `pid`: The PID of the currently running Nushell process.
- `os-info`: Information about the host operating system.
- `startup-time`: The amount of time (in duration) that it took for Nushell to start and process all configuration files.
Expand Down
2 changes: 1 addition & 1 deletion cookbook/ssh_agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ You can work around this behavior by checking if a ssh-agent is already running
```nu
do --env {
let ssh_agent_file = (
$nu.temp-path | path join $"ssh-agent-(whoami).nuon"
$nu.temp-dir | path join $"ssh-agent-(whoami).nuon"
)

if ($ssh_agent_file | path exists) {
Expand Down
2 changes: 1 addition & 1 deletion fr/book/thinking_in_nu.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Cela ne fonctionne pas si `my_path` est une variable déclarée au runtime avec
Cependant, si `my_path` est une [constante](/book/variables#constant-variables), cela fonctionnera, car la chaîne de caractères peut être évaluée au moment de la compilation :

```nu
const my_path = ([$nu.home-path nushell] | path join)
const my_path = ([$nu.home-dir nushell] | path join)
source $"($my_path)/common.nu" # sources /home/user/nushell/common.nu
```

Expand Down
4 changes: 2 additions & 2 deletions ko/book/special_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ next:
- `history-path`: 명령 기록을 저장하는 텍스트 또는 SQLite 파일.
- `loginshell-path`: 로그인 셸에 대해 실행되는 선택적 구성 파일, 일반적으로 구성 디렉터리의 `login.nu`입니다.
- `plugin-path`: 플러그인 레지스트리 파일, 일반적으로 구성 디렉터리의 `plugin.msgpackz`입니다.
- `home-path`: 약어 `~`를 사용하여 액세스할 수 있는 사용자의 홈 디렉터리.
- `home-dir`: 약어 `~`를 사용하여 액세스할 수 있는 사용자의 홈 디렉터리.
- `data-dir`: 시작 시 로드되는 `./vendor/autoload` 디렉터리 및 기타 사용자 데이터를 포함하는 누셸의 데이터 디렉터리.
- `cache-dir`: 필수적이지 않은(캐시된) 데이터용 디렉터리.
- `vendor-autoload-dirs`: 시작 시 자동으로 로드될 구성 파일을 타사 응용 프로그램이 설치해야 하는 디렉터리 목록입니다.
- `user-autoload-dirs`: 사용자가 시작 시 자동으로 로드될 추가 구성 파일을 만들 수 있는 디렉터리 목록입니다.
- `temp-path`: 사용자가 쓸 수 있어야 하는 임시 파일 경로.
- `temp-dir`: 사용자가 쓸 수 있어야 하는 임시 파일 경로.
- `pid`: 현재 실행 중인 누셸 프로세스의 PID.
- `os-info`: 호스트 운영 체제에 대한 정보.
- `startup-time`: 누셸이 시작되고 모든 구성 파일을 처리하는 데 걸린 시간(기간).
Expand Down
4 changes: 2 additions & 2 deletions zh-CN/book/special_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ Nushell 提供并使用了一系列特殊变量和常量。其中许多在本手
- `history-path`: 存储命令历史的文本或 SQLite 文件
- `loginshell-path`: 登录 shell 运行的可选配置文件,通常是配置目录中的 `login.nu`
- `plugin-path`: 插件注册表文件,通常是配置目录中的 `plugin.msgpackz`
- `home-path`: 用户的主目录,可以使用简写 `~` 访问
- `home-dir`: 用户的主目录,可以使用简写 `~` 访问
- `data-dir`: Nushell 的数据目录,包括启动时加载的 `./vendor/autoload` 目录和其他用户数据
- `cache-dir`: 用于非必要(缓存)数据的目录
- `vendor-autoload-dirs`: 第三方应用应安装配置文件的目录列表,这些文件将在启动时自动加载
- `user-autoload-dirs`: 用户可以创建额外配置文件的目录列表,这些文件将在启动时自动加载
- `temp-path`: 用户可写的临时文件路径
- `temp-dir`: 用户可写的临时文件路径
- `pid`: 当前运行的 Nushell 进程的 PID
- `os-info`: 主机操作系统信息
- `startup-time`: Nushell 启动并处理所有配置文件所花费的时间(持续时间)
Expand Down
2 changes: 1 addition & 1 deletion zh-CN/cookbook/ssh_agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ title: ssh-agent
```nu
do --env {
let ssh_agent_file = (
$nu.temp-path | path join $"ssh-agent-($env.USER? | default $env.USERNAME).nuon"
$nu.temp-dir | path join $"ssh-agent-($env.USER? | default $env.USERNAME).nuon"
)

if ($ssh_agent_file | path exists) {
Expand Down