jordilin
January 16th, 2007, 04:54 PM
I have the following:
if [ -f $NAME=$dir"/"$NEWNAME\_$j".jpg" ]
then
echo "file already exists"
exit 0
else
echo $NAME
mv $i $NAME
fi
let "j+=1"
but, I think that the NAME variable is not correct inside the if. Is there a way to do an assignment inside an if? Thanks
if [ -f $NAME=$dir"/"$NEWNAME\_$j".jpg" ]
then
echo "file already exists"
exit 0
else
echo $NAME
mv $i $NAME
fi
let "j+=1"
but, I think that the NAME variable is not correct inside the if. Is there a way to do an assignment inside an if? Thanks