I keep trying to run this code but I keep getting the error "curl: option -: is unknown".
#!/bin/bash
for i in $(eval echo {$1..$2})
do
rm -f end-cookie.jar
curl -c end-cookie.jar - L http://www.endclothing.com/checkout/cart/add/eunc/a,,/product/204726 -s -o /dev/null
url=`curl -b end-cookie.jar -w "%{url_effective}\n" - L -s -S -o /dev/null http://www.endclothing.com/checkout/cart/add/uenc/a,,/product/$i`
echo $i - $url
done
and when I run that I get the error:
$ ./TheEnd.sh
curl: option -: is unknown
curl: try 'curl --help' or 'curl --manual' for more information
curl: option -: is unknown
curl: try 'curl --help' or 'curl --manual' for more information
{..} -
How do I fix this? I don't know much about linux, but I am sure that I am not mentioning any -: option in my code.
It's true that cUrl has a weird habit of blaming a phantomatic -: option for other tricky reasons (I've encountered myself for example while trying to obtain hex POST data dumps), but I reckon this is not happening in your case: it looks like you have a space between the hyphen and the capital L.
Try removing that; i.e.
- L
Becomes
-L
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With