L7Sqr
Practically a Posting Shark
851 posts since Feb 2011
Reputation Points: 253
Solved Threads: 155
Skill Endorsements: 7
if [ -d $1 ]
then
echo "Yes this is a directory"
else
echo "No this is not a directory"
fi
cd $1
echo "dir is: `pwd`"
KMat, what happens when $1 is not a directory? What do you think will happen when you do cd $1 ?
L7Sqr
Practically a Posting Shark
851 posts since Feb 2011
Reputation Points: 253
Solved Threads: 155
Skill Endorsements: 7