1

Possible Duplicate:
Why doesn’t “cd” work in a bash shell script?
Go back to Previous Directory in Linux using a C program

The chdir function changes the directory, but it does not change the original directory.

For example:

$ pwd
  ~/home/loganaayahee
 $ cc chdir
 $ ./a.out ~/Desktop
 The directory change sucess and the current dir is ~/Desktop
 $ pwd
 ~/home/loganaayahee

The shell does not change the directory. What is the reason? so I do change the original directory what i do?. what purpose usedto the chdir() function?

Community
  • 1
  • 1
loganaayahee
  • 809
  • 2
  • 8
  • 13

0 Answers0