Tag Info

New answers tagged

0

Try something like wget -qO- http://www.google.com/ | tr " " \\n | fgrep src= | tr \" \\n | fgrep -v src= which will, however, output URLs as they are written in the file - which may be relative the the base URL.


6

What your routine is lacking is some way to exit once the correct i is found. For that you can look at the exit code given back from curl: for i in {2000..3000} do curl http://admin:$i@mywebsite.com/link if [ "$?" -eq 0 ]; then echo Found "$i" break fi done The exit value of curl is 0 when everything is correct and can be checked directly ...


1

You would almost think that you invented the syntax for GNU Parallel: ... | parallel -N5 curl www.google.com/{1}/testing/{2}/{3}/works/{5} You get the added benefit that you will be running one curl per CPU. GNU Parallel is a general parallelizer and makes is easy to run jobs in parallel on the same machine or on multiple machines you have ssh access ...



Top 50 recent answers are included