Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

The cd command doesn seem to work. What am I doing wrong?

CD Command doing wrong
0
Posted

The cd command doesn seem to work. What am I doing wrong?

0

The current working directory (cwd) is a property of a process in Unix (or Windows). You are creating a Process object to run the command. The cd command is indeed changing the cwd of the process, but when the command terminates, the process goes away and there is no effect on your main shell program. The reason cd works like it does in a “real” shell is that the shell treats it specially. You are not required to implement this feature.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123