If I execute it, I got an error from curl, saying it cannot resolve
the proxy '.
But If I modify the script to:
url="http://mypage"
curl $url -d "mydata" -x '
It works fine.
I guess there's something wrong with the argument expansion. Just do
not know how to fix it. Please help.
--
Best Regards,
Xi Shen (David)
http://twitter.com/davidshen84/
05-09-2011, 06:43 AM
Nils Andresen
bash script error
Hi,
have you tried "/bin/bash -x your.script.sh" - see what get's expanded ?
Nils
2011/5/9 Xi Shen <davidshen84@googlemail.com>
I guess there's something wrong with the argument expansion. Just do
not know how to fix it. Please help.
05-09-2011, 07:48 AM
Xi Shen
bash script error
yes, you are right.
+ curl_opts='-x '
the "-x '" expands to too many quotes. I tried to replace the
double-quotes to single-quotes, but still not working.
any idea how to fix this?
On Mon, May 9, 2011 at 2:43 PM, Nils Andresen <nils@nils-andresen.de> wrote:
> Hi,
> have you tried "/bin/bash -x your.script.sh" - see what get's expanded ?
>
> Nils
>
> 2011/5/9 Xi Shen <davidshen84@googlemail.com>
>>
>> I guess there's something wrong with the argument expansion. Just do
>> not know how to fix it. Please help.
>>
>
--
Best Regards,
Xi Shen (David)
http://twitter.com/davidshen84/
05-09-2011, 07:52 AM
Kfir Lavi
bash script error
On Mon, May 9, 2011 at 9:43 AM, Nils Andresen <nils@nils-andresen.de> wrote:
Hi,
have you tried "/bin/bash -x your.script.sh" - see what get's expanded ?
Nils
2011/5/9 Xi Shen <davidshen84@googlemail.com>
I guess there's something wrong with the argument expansion. Just do
not know how to fix it. Please help.
You need to change:
- curl_opts="-x '"
+ curl_opts=-x ""
Run your program with bash -x as Nils said, and you will see the expansion.
Kfir
05-09-2011, 08:14 AM
Xi Shen
bash script error
yes, i use the '-x' option, and i can see the expansion now. and i
found there are too many quotes.
i tried curl_opts=-x "", does not work.
On Mon, May 9, 2011 at 3:52 PM, Kfir Lavi <lavi.kfir@gmail.com> wrote:
>
>
> On Mon, May 9, 2011 at 9:43 AM, Nils Andresen <nils@nils-andresen.de> wrote:
>>
>> Hi,
>> have you tried "/bin/bash -x your.script.sh" - see what get's expanded ?
>>
>> Nils
>>
>> 2011/5/9 Xi Shen <davidshen84@googlemail.com>
>>>
>>> I guess there's something wrong with the argument expansion. Just do
>>> not know how to fix it. Please help.
>>>
> You need to change:
> - curl_opts="-x '"
> + curl_opts=-x ""
>
> Run your program with bash -x as Nils said, and you will see the expansion.
>
> Kfir
>
--
Best Regards,
Xi Shen (David)
http://twitter.com/davidshen84/
05-09-2011, 08:23 AM
Xi Shen
bash script error
if i use -x ', or -x "", it expands to -x. the quotes are removed as
they are empty.
if i use -x ', the expanded quotes are quoted again...resulting too
many quotes
it is driving me crazy o_O! please help.
On Mon, May 9, 2011 at 4:14 PM, Xi Shen <davidshen84@googlemail.com> wrote:
> yes, i use the '-x' option, and i can see the expansion now. and i
> found there are too many quotes.
>
> i tried curl_opts=-x "", does not work.
>
>
> On Mon, May 9, 2011 at 3:52 PM, Kfir Lavi <lavi.kfir@gmail.com> wrote:
>>
>>
>> On Mon, May 9, 2011 at 9:43 AM, Nils Andresen <nils@nils-andresen.de> wrote:
>>>
>>> Hi,
>>> have you tried "/bin/bash -x your.script.sh" - see what get's expanded ?
>>>
>>> Nils
>>>
>>> 2011/5/9 Xi Shen <davidshen84@googlemail.com>
>>>>
>>>> I guess there's something wrong with the argument expansion. Just do
>>>> not know how to fix it. Please help.
>>>>
>> You need to change:
>> - curl_opts="-x '"
>> + curl_opts=-x ""
>>
>> Run your program with bash -x as Nils said, and you will see the expansion.
>>
>> Kfir
>>
>
>
>
> --
> Best Regards,
> Xi Shen (David)
>
> http://twitter.com/davidshen84/
>
--
Best Regards,
Xi Shen (David)
http://twitter.com/davidshen84/
05-09-2011, 08:30 AM
Pandu Poluan
bash script error
(Forgive my top-posting)
try:
curl_opts="-x '"
Rgds,
On 2011-05-09, Xi Shen <davidshen84@googlemail.com> wrote:
> yes, i use the '-x' option, and i can see the expansion now. and i
> found there are too many quotes.
>
> i tried curl_opts=-x "", does not work.
>
>
> On Mon, May 9, 2011 at 3:52 PM, Kfir Lavi <lavi.kfir@gmail.com> wrote:
>>
>>
>> On Mon, May 9, 2011 at 9:43 AM, Nils Andresen <nils@nils-andresen.de>
>> wrote:
>>>
>>> Hi,
>>> have you tried "/bin/bash -x your.script.sh" - see what get's expanded ?
>>>
>>> Nils
>>>
>>> 2011/5/9 Xi Shen <davidshen84@googlemail.com>
>>>>
>>>> I guess there's something wrong with the argument expansion. Just do
>>>> not know how to fix it. Please help.
>>>>
>> You need to change:
>> - curl_opts="-x '"
>> + curl_opts=-x ""
>>
>> Run your program with bash -x as Nils said, and you will see the
>> expansion.
>>
>> Kfir
>>
>
>
>
> --
> Best Regards,
> Xi Shen (David)
>
> http://twitter.com/davidshen84/
>
>
--
--
Pandu E Poluan - IT Optimizer
My website: http://pandu.poluan.info/
05-09-2011, 08:31 AM
Pandu Poluan
bash script error
(Again, sorry for top-posting)
BTW, there are lots of bash gurus in stackovervlow.com. My handle
there is 'pepoluan'.
Rgds,
On 2011-05-09, Xi Shen <davidshen84@googlemail.com> wrote:
> It is not specific to Gentoo. But do not know where to search or post it
>
> My script looks like:
>
> url="http://mypage"
> curl_opts="-x '"
> curl $url -d "mydata" $curl_opts
>
> If I execute it, I got an error from curl, saying it cannot resolve
> the proxy '.
>
> But If I modify the script to:
>
> url="http://mypage"
> curl $url -d "mydata" -x '
>
> It works fine.
>
> I guess there's something wrong with the argument expansion. Just do
> not know how to fix it. Please help.
>
>
> --
> Best Regards,
> Xi Shen (David)
>
> http://twitter.com/davidshen84/
>
>
--
--
Pandu E Poluan - IT Optimizer
My website: http://pandu.poluan.info/
05-09-2011, 09:00 AM
Xi Shen
bash script error
i tried that already. not working. i will try the stackoverflow.com. thanks
On Mon, May 9, 2011 at 4:31 PM, Pandu Poluan <pandu@poluan.info> wrote:
> (Again, sorry for top-posting)
>
> BTW, there are lots of bash gurus in stackovervlow.com. My handle
> there is 'pepoluan'.
>
> Rgds,
>
>
> On 2011-05-09, Xi Shen <davidshen84@googlemail.com> wrote:
>> It is not specific to Gentoo. But do not know where to search or post it
>>
>> My script looks like:
>>
>> url="http://mypage"
>> curl_opts="-x '"
>> curl $url -d "mydata" $curl_opts
>>
>> If I execute it, I got an error from curl, saying it cannot resolve
>> the proxy '.
>>
>> But If I modify the script to:
>>
>> url="http://mypage"
>> curl $url -d "mydata" -x '
>>
>> It works fine.
>>
>> I guess there's something wrong with the argument expansion. Just do
>> not know how to fix it. Please help.
>>
>>
>> --
>> Best Regards,
>> Xi Shen (David)
>>
>> http://twitter.com/davidshen84/
>>
>>
>
>
> --
> --
> Pandu E Poluan - IT Optimizer
> My website: http://pandu.poluan.info/
>
>
--
Best Regards,
Xi Shen (David)
http://twitter.com/davidshen84/
05-09-2011, 09:25 AM
Kfir Lavi
bash script error
On Mon, May 9, 2011 at 12:00 PM, Xi Shen <davidshen84@googlemail.com> wrote:
i tried that already. not working. i will try the stackoverflow.com. thanks
On Mon, May 9, 2011 at 4:31 PM, Pandu Poluan <pandu@poluan.info> wrote:
> (Again, sorry for top-posting)
>
> BTW, there are lots of bash gurus in stackovervlow.com. My handle
> there is 'pepoluan'.
>
> Rgds,
>
>
> On 2011-05-09, Xi Shen <davidshen84@googlemail.com> wrote:
>> It is not specific to Gentoo. But do not know where to search or post it
>> I guess there's something wrong with the argument expansion. Just do
>> not know how to fix it. Please help.
>>
>>
>> --
>> Best Regards,
>> Xi Shen (David)
>>
>> http://twitter.com/davidshen84/
>>
>>
>
>
> --
> --
> Pandu E Poluan - IT Optimizer
> My website: http://pandu.poluan.info/
>
>
--
Best Regards,
Xi Shen (David)
http://twitter.com/davidshen84/
I have replied you before.
What I have sent you is the solution to your problems.
Try to run what I told you.
I ran it successfully on my comp.
curl_opts=-x ""