2022-02-14 03:22:51 +01:00
|
|
|
---
|
|
|
|
title: def-env
|
|
|
|
layout: command
|
|
|
|
version: 0.59.0
|
|
|
|
---
|
|
|
|
|
|
|
|
Define a custom command, which participates in the caller environment
|
|
|
|
|
|
|
|
## Signature
|
|
|
|
|
|
|
|
```> def-env (def_name) (params) (block)```
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
- `def_name`: definition name
|
|
|
|
- `params`: parameters
|
|
|
|
- `block`: body of the definition
|
|
|
|
|
2022-02-21 18:26:00 +01:00
|
|
|
## Examples
|
|
|
|
|
|
|
|
Set environment variable by call a custom command
|
|
|
|
```shell
|
|
|
|
> def-env foo [] { let-env BAR = "BAZ" }; foo; $env.BAR
|
|
|
|
```
|