I am using chdir()
to change directory to the value passed as an argument to this function.
I understand that when I run my C program using gcc myCd.c
and ./a.out ..
this changes the directory to the parent directory "within" the C program (i.e. a child process is spawned for the a.out process, and the change of directory happens within that child process).
What I want to do is, change the directory at the terminal using this C program. I tried writing a shell script for the same, and then sourcing it, and running, that works, but I wanted to achieve this using C.