Hi all
I have some script like this
#!/bin/bash
mv /tmp/file1 tmp/file2
if [[ $? -eq 0 ]] ; then
cp /tmp/filetest/ tmp/file3
if [[ $? -eq 0 ]] then
echo "succes"
else
echo "failed"
fi
else
echo "failed"
fi
i didn't try to see if it's work, the thing is that i don't care if it's failed in phase one or two, is there any way to short this written without all this echo
somethis like this
#!/bin/bash
mv /tmp/file1 tmp/file2
if [[ $? -eq 0 ]] ; then
cp /tmp/filetest/ tmp/file3
if [[ $? -eq 0 ]] then
echo "succes"
else
go to fail
fi
else
go to fail
fi
fail.
echo "script failed"
.
or any other way to short this complex script.
thank you very much
best regards