I'm submitting to my website using cURL. I make cURL post it in timely fashion.In below code; first line is curl submit; second line is for queuing:curl -b cookies.txt \    -d title=$(sed '1,/sblmtitle/d;/slpstitle/,$d' sedut.html) \    -d taxonomy%5Btags%5D%5B1%5D=$(        sed '1,/sblmkategori/d;/slpskategori/,$d' sedut.html    ) \    -d teaser_include=1 \    -d body=$(sed '1,/sblmkonten/d;/slpskonten/,$d' sedut.html) \    -d field_source%5B0%5D%5Burl%5D=$(        sed '1,/sblmurl/d;/slpsurl/,$d' sedut.html    ) \    -d changed= \    -d form_build_id=form-424f851ad50bd4781c8c25ab7efd5c4c \    -d form_token=0e7cc7437faf816f1ecd96087286bda9 \    -d form_id=post_node_form \    -d op=Save http://www.web.org/submit/post &&for file in $(ls *.html | sort -r | tail -1); do    mv $file sedut.htmldoneIf cURL fails to submit, it will print out sedut.html contents. If cURL success submitting, it will print nothing. In my case, sometime cURL fails to submit.What I want is don't execute second line if first line fails. But using && as above codes is just not works. I've tested it, cURL submit fails and print out sedut.html contents, but second line still executed. 
Using && is not effective for cURL submit form (don't execute second line if first line fails)
command line;curl
curl has no idea that it failed - it had well-defined input, it communicated with the server and got back a 200 OK response. Because of this, you can't rely on the exit code of curl (which is what && does).Instead, we have to use something else to determine success or failure, such as the output generated by curl.As a side note, it is generally not a good idea to use ls in a script. Here, it will fail if a file happens to have a newline or a space character. It may be unlikely, but but it's possible. See http://mywiki.wooledge.org/ParsingLs for more details. As a rule of thumb, I only use ls in scripts when displaying the results for human eyes. If I'm processing the results in any way, I use find . -0 ...