unlet

For experimental.

Delete variables from nushell memory, making them unrecoverable.

Command Type

built-in

Signature

> unlet {flags} ...rest

Parameters

  • ...rest: The variables to delete (pass as $variable_name).

Input/output types:

input output
nothing nothing

Examples

Delete a variable from memory.

> let x = 42; unlet $x

Delete multiple variables from memory.

> let x = 1; let y = 2; unlet $x $y

Attempting to delete a built-in variable fails.

> unlet $nu

Attempting to delete a non-variable fails.

> unlet 42

Ported from nushell/nushell.github.io. Copyright (c) 2021 Nushell Project. MIT License.