pwd(n)

πŸ“¦
version 9.0.3 Β· 3 versions
, in alpine 3.23, alpine 3.24, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay so bestie, meet pwd(n) β€” a Tcl Built-In Command that returns the absolute path of the current working directory. From the Tcl Built-In Commands manual, page pwd(n). That's the whole job. iconic ✨


✨ SYNOPSIS ✨

pwd

That's the whole synopsis, bestie. No drama, just pwd πŸ’…


πŸ’– DESCRIPTION πŸ’–

When you run pwd, it returns the absolute path name of the current working directory. Like, the full path name, no cap. Slay. 🫢


🌸 EXAMPLE 🌸

Sometimes it is useful to change to a known directory when running some external command using exec, but it is important to keep the application usually running in the directory that it was started in β€” unless the user specifies otherwise β€” since that minimizes user confusion. The way to do this is to save the current directory while the external command is being run, like this:

set tarFile [file normalize somefile.tar]
set savedDir [pwd]
cd /tmp
exec tar -xf $tarFile
cd $savedDir

Save the dir, dip out, do the thing, come back. Main character energy fr fr πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘


🧚 KEYWORDS 🧚

  • working directory

Source/version: Tcl, page pwd(n); date: not listed in the original footer, bestie β€” mwah πŸ’–βœ¨ periodt πŸ’…

πŸ“¦ where this page comes from