In this script following curl command is doing the trick
for CDR in $(find $CDRDIR -name "*.cdr.xml"); do
echo "Resubmitting $(basename $CDR .cdr.xml)..."
echo -n 'cdr='$(cat $CDR) | \
curl -sS -X POST -f --$AUTH_SCHEME -u $CRED -d @- $URL >/dev/null \
&& echo "OK, removing CDR file" \
&& rm -f $CDR
done My question is how to handle the case when even this submission fails because of any reason?..I want to skip the remove file step in case again some error happens with web server, How can I do that?