Computing.Net > Forums > Unix > Change directory

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Change directory

Reply to Message Icon

Name: Frankie
Date: December 20, 2001 at 03:31:16 Pacific
Comment:

I have test a dummy program, say test.h , this program only contains one line " cd /usr ", after I run this program, my current path is still my home directory , say /home/abc , but not /usr , do you know why?



Sponsored Link
Ads by Google

Response Number 1
Name: Acce
Date: December 20, 2001 at 04:10:25 Pacific
Reply:

I want to upload a file from windows to UNIX, except ftp what protocal such as zmodem, kermit etc is better to do that, If I need to specify the source path (eg. c:\temp) to destination path ( /tmp) , what is the parameter to do that.


0

Response Number 2
Name: Anthony Foot
Date: December 20, 2001 at 04:35:05 Pacific
Reply:

Answer to first question:
When you run a shell script it creates it's own shell, and that is where the change directory takes place. When your program finishes it reverts back to your original shell and you will be back in your original directory. To force the script to run in your current shell put a full stop and space in front of the shell script name:
. testh


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


pop3 Where do I find a good UN...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Change directory

changing directories www.computing.net/answers/unix/changing-directories/5784.html

Changing directory www.computing.net/answers/unix/changing-directory/6882.html

Novice - change dir in shell script www.computing.net/answers/unix/novice-change-dir-in-shell-script/4762.html