From 352aeaaebc340777279fe002b582a237503dce72 Mon Sep 17 00:00:00 2001 From: Filipp Samoilov Date: Sun, 31 May 2026 09:45:24 +0300 Subject: [PATCH] Add mentions of percent sigils to aliases and string execution --- book/aliases.md | 9 +++++++++ lang-guide/chapters/strings_and_text.md | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/book/aliases.md b/book/aliases.md index 03f534399ad..b1c4f218c63 100644 --- a/book/aliases.md +++ b/book/aliases.md @@ -125,3 +125,12 @@ def ls [ ) | sort-by type name -i } ``` + +To call the underlying built-in command you can use a percent sigil `%`, e.g. +```nu +def ls [] { + "something else" +} + +%ls # <- calls the original ls +``` diff --git a/lang-guide/chapters/strings_and_text.md b/lang-guide/chapters/strings_and_text.md index b33c3e9fe1a..539796dbdc6 100644 --- a/lang-guide/chapters/strings_and_text.md +++ b/lang-guide/chapters/strings_and_text.md @@ -40,6 +40,13 @@ let arguments = ["arg1", "-a", "arg2"] The caret `^` before the string interpolation symbol `$` allows that external command to be executed. +The percent sigin `%` can be used to call the built-in command (without arguments). + +```nu +let cmd = "ls" +%$cmd +``` + ## String Quoting ### Double quotes