1pwd(n) Tcl Built-In Commands pwd(n)
2
3
4
5______________________________________________________________________________
6
8 pwd - Return the absolute path of the current working directory
9
11 pwd
12_________________________________________________________________
13
14
16 Returns the absolute path name of the current working directory.
17
19 Sometimes it is useful to change to a known directory when running some
20 external command using exec, but it is important to keep the applica‐
21 tion usually running in the directory that it was started in (unless
22 the user specifies otherwise) since that minimizes user confusion. The
23 way to do this is to save the current directory while the external com‐
24 mand is being run:
25 set tarFile [file normalize somefile.tar]
26 set savedDir [pwd]
27 cd /tmp
28 exec tar -xf $tarFile
29 cd $savedDir
30
32 file(n), cd(n), glob(n), filename(n)
33
34
36 working directory
37
38
39
40Tcl pwd(n)