On Unix, cd - can switch back to previous directory. I was wondering if there’s a similar command in tcl interpreter can do the same?
On Unix, cd – can switch back to previous directory. I was wondering if
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, there is no directory stack in Tcl, and previous directory is not remembered anywhere.
TclX provides
pushdandpopdcommands for directory stack, but it does not modifycdcommand to put anything there. It can be done by command wrapping and renaming, but I wouldn’t recommend it for something that can be used in a script (at least, don’t override semantics ofcd -).