Tag Info

New answers tagged

1

Use this as your condition... res=`curl -s --head <URL> | head -n 1 | grep -c HTTP/1.1 200 OK` if [ $res -eq 1 ] then MSG = " OKAY" EXIT_CODE = 0 else MSG = " NOT OKAY" EXIT_CODE = 2 fi


2

libcurl does not support the rsync protocol. From the libcurl FAQ: Section 3.21 3.21 Protocol xxx not supported or disabled in libcurl When passing on a URL to curl to use, it may respond that the particular protocol is not supported or disabled. The particular way this error message is phrased is because curl doesn't make a distinction ...


0

Take a look at Rainbow Stream - smart/beautiful and written in Python. It provides a rainbow shell which can start by $ rainbowstream and inside the app, updating a status is quite easy with [@yourTwitterName]: t tweeting from #rainbowstream


21

It is specific to curl. From man curl: --data-binary <data> (HTTP) This posts data exactly as specified with no extra processing whatsoever. If you start the data with the letter @, the rest should be a filename. Data is posted in a similar manner as --data-ascii does, except that newlines are preserved and conversions are never done. If ...


0

You could simply copy the headers provided in your /usr/include path. No? Obviously don't forget to link the library when you compile your sources. I tried and it works like a charm!


2

What exact command do you use to build executable of your program? You need to tell g++ about additional directories with project-specific headers and libraries. If you have libcurlcpp.a copied into $proj_home/lib and libcurlcpp.h copied into $proj_home/hdr this will be something like: $ g++ your_program.cpp -Ihdr -Llib -lcurlcpp -static -o ...


2

Yes, easily. For example: for num in 100 200 300; do curl "http://foo.bar&skip=$num" ; done Or, you can have the list of numbers in a file (one per line) and use a while loop: while read num; do curl "http://foo.bar&skip=$num" ; done < nums.txt Or even generate them using seq: seq 100 100 300 | while read num; do curl ...


2

The main issue is that sed works on lines so it doesn't do anything until the first \n is reached and that doesn't happen until your command is finished. You can get around this by exchanging \rs with \ns: $ curl --progress-bar http://127.0.0.1/test.tar.bz2 -o test.tar.bz2 2>&1 | tr $'\r' $'\n' | sed -r 's/[# ]+/#/g;' This, however, brings you ...



Top 50 recent answers are included