Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

linux terminal curl: option -: is unknown error [closed]

Tags:

linux

curl

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.

like image 527
user3150552 Avatar asked Oct 29 '25 00:10

user3150552


1 Answers

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
like image 104
Graham Savage Avatar answered Oct 31 '25 22:10

Graham Savage