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
15 Returns the absolute path name of the current working directory.
16
18 Sometimes it is useful to change to a known directory when running some
19 external command using exec, but it is important to keep the applica‐
20 tion usually running in the directory that it was started in (unless
21 the user specifies otherwise) since that minimizes user confusion. The
22 way to do this is to save the current directory while the external com‐
23 mand is being run:
24
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
35 working directory
36
37
38
39Tcl pwd(n)