Write a shell script to change a directory?
echo “ enter a directory name “
read
dname
if
[ -d “$dname” ]
cd
$ dname
echo
“ you are currently in “
pwd
else
echo
“ directory doesnot exist “
exit
fi
OUTPUT:
enter
a directory name
dir
directory
dir exist
you
are currently in
/ home / user / dir
Comments
Post a Comment