W3cubDocs

/Nushell

path join for path

Join a structured path or a list of path parts.

Signature

> path join {flags} ...rest

Parameters

  • ...rest: Path to append to the input

Input/output types:

input output
list<string> string
record string
string string
table list<string>

Examples

Append a filename to a path

>'/home/viking'|path joinspam.txt
/home/viking/spam.txt

Append a filename to a path

>'/home/viking'|path joinspamsthis_spam.txt
/home/viking/spams/this_spam.txt

Join a list of parts into a path

> [ '/''home''viking''spam.txt' ] |path join
/home/viking/spam.txt

Join a structured path into a path

> { parent:'/home/viking', stem:'spam', extension:'txt' } |path join
/home/viking/spam.txt

Join a table of structured paths into a list of paths

> [[ parentstemextension ]; [ '/home/viking''spam''txt' ]] |path join
╭───┬───────────────────────╮
0/home/viking/spam.txt
╰───┴───────────────────────╯

Notes

Optionally, append an additional path to the result. It is designed to accept the output of 'path parse' and 'path split' subcommands.

Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/path_join.html