custom UNIX shell
Posted: Tue Oct 20, 2009 8:13 pm
Hi I'm learning about UNIX shell using Ubuntu 9.04. I'm wondering how a "cd <directory>", "dir <directory>" and "printenv" in bash shell work and try to replicate it.
It doesn't have to be as complex but I wonder how to code it. Basically when running my own shell program such as "ishell cd <directory>" it will change the current default directory to <directory> and also change the PWD environment variable; and "ishell dir <directory>" will list the content of the directory; "ishell env" will list all the environment strings.
Thanks!
It doesn't have to be as complex but I wonder how to code it. Basically when running my own shell program such as "ishell cd <directory>" it will change the current default directory to <directory> and also change the PWD environment variable; and "ishell dir <directory>" will list the content of the directory; "ishell env" will list all the environment strings.
Thanks!