Hi,
I am working on a shell script that would verify if the mount command has executed or not. So , i have been doing this.
mount /dev/cdrom /mnt/cdrom
echo "$?"
if [ "$?" = "0" ]; then
echo " Mount succesful"
else
echo " Mount unsuccessful"
fi
I have the problem with the if stmt. It is displaying " Mount successful even when it hasn't"
for example
echo "$?" would give 32, instead of going else loop, it still enters the if block of the code.
Can somebody help me with this.?
--Sundeep