October 17th, 2010, 05:18 PM
Help needed for shell programming
This is my first time writing a shell..I have been asked to a program to change the current default directory..to <directory>. If the <directory> argument is not present, report the current directory. If the directory does not exist an appropriate error should be reported.
I know the cd command so also I know how to write a program in C. But how do I chekc if the directory is present or not ?I am not getting how to use cd command in a program..
October 18th, 2010, 06:46 AM
October 18th, 2010, 03:38 PM
should be valid argument for it.
[ -d $DIR ]