Skip to main content
added 1 character in body
Source Link

In my benchmarking, the wget solution was slightly (4%) faster thethan the curl-based solution.

In my benchmarking, the wget solution was slightly (4%) faster the the curl-based solution.

In my benchmarking, the wget solution was slightly (4%) faster than the curl-based solution.

Added benchmark result
Source Link

In my benchmarking, the wget solution was slightly (4%) faster the the curl-based solution.

Update: See my curl-based answer for fastest solution.

In my benchmarking, the wget solution was slightly (4%) faster the the curl-based solution.

Update: See my curl-based answer for fastest solution.

Added comparison to the curl-based solution
Source Link
wget -S --spider https://rb.gy/x7cg8r 2>&1 \
 | sed -En 's/^--[[:digit:]: -]{19}--  (.*)/\1/p'

Compared to the curl-based solution...

The curl-based solution omits the first url in the redirect chain:

$ curl -v -L https://rb.gy/x7cg8r 2>&1 | grep -i "^< location:"
< Location: https://t.co/BAvVoPyqNr
< location: https://unix.stackexchange.com/

Furthermore, it incurs a 4354.99% increase in bytes sent to second pipeline stage:

$ wget -S --spider https://rb.gy/x7cg8r 2>&1 | wc -c
2728

$ curl -v -L https://rb.gy/x7cg8r 2>&1 | wc -c
121532

$ awk 'BEGIN {printf "%.2f\n", (121532-2728)/2728*100}'
4354.99
wget -S --spider https://rb.gy/x7cg8r 2>&1 \
 | sed -En 's/^--[[:digit:]: -]{19}-- (.*)/\1/p'
wget -S --spider https://rb.gy/x7cg8r 2>&1 \
 | sed -En 's/^--[[:digit:]: -]{19}--  (.*)/\1/p'

Compared to the curl-based solution...

The curl-based solution omits the first url in the redirect chain:

$ curl -v -L https://rb.gy/x7cg8r 2>&1 | grep -i "^< location:"
< Location: https://t.co/BAvVoPyqNr
< location: https://unix.stackexchange.com/

Furthermore, it incurs a 4354.99% increase in bytes sent to second pipeline stage:

$ wget -S --spider https://rb.gy/x7cg8r 2>&1 | wc -c
2728

$ curl -v -L https://rb.gy/x7cg8r 2>&1 | wc -c
121532

$ awk 'BEGIN {printf "%.2f\n", (121532-2728)/2728*100}'
4354.99
Source Link
Loading