Impressum
GoTo:
Home
 
Metaphern Akazien Verlag   
 
Lesezeichen [ Info # Jobs # QR-Code # MagicWords ]Fr 29 März 2024 07:54:08


 huecker.com # Grundlagen der Programmierung | Tcl Tutorial.
--

 

. Changing Working Directory - cd, pwd .

[ Previous | Index | Next ]

Tcl also supports commands to change and display the current working directory.

These are:

cd ?dirName?
Changes the current directory to dirName (if dirName is given, or to the $HOME directory if dirName is not given. If dirname is a tilde (~, cd changes the working directory to the users home directory. If dirName starts with a tilde, then the rest of the characters are treated as a login id, and cd changes the working directory to that user's $HOME.
pwd
Returns the current directory.

--

. Example .

   set dirs [list TEMPDIR]

   puts "[format "%-15s  %-20s " "FILE" "DIRECTORY"]"

   foreach dir $dirs {
    catch {cd $dir}
    set c_files [glob -nocomplain c*]
    foreach name $c_files {
     puts "[format "%-15s  %-20s " $name [pwd]]"
    }
   }
  

--
[ Home | Top ]
[ . Previous | Index | Next . ]
Der Inhalt dieser Seite wurde am 06.11.2019 um 12.19 Uhr aktualisiert.
Navigation Seminare Magic Software Projekte Publikationen Kontakt Home
 
   huecker dot com * Germany | Datenschutz
© 1999, 2024 Franz-Josef Hücker. All Rights Reserved.
Send Page Print Page LinkedIn follow me on twitter RSS Feeds & Podcasts