FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 05-09-2011, 05:44 AM
Xi Shen
 
Default bash script error

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/
 
Old 05-09-2011, 06:43 AM
Nils Andresen
 
Default 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.
 
Old 05-09-2011, 07:48 AM
Xi Shen
 
Default 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/
 
Old 05-09-2011, 07:52 AM
Kfir Lavi
 
Default 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
 
Old 05-09-2011, 08:14 AM
Xi Shen
 
Default 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/
 
Old 05-09-2011, 08:23 AM
Xi Shen
 
Default 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/
 
Old 05-09-2011, 08:30 AM
Pandu Poluan
 
Default 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/
 
Old 05-09-2011, 08:31 AM
Pandu Poluan
 
Default 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/
 
Old 05-09-2011, 09:00 AM
Xi Shen
 
Default 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/
 
Old 05-09-2011, 09:25 AM
Kfir Lavi
 
Default 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

>>

>> My script looks like:

>>

>> url="" href="http://mypage" target="_blank">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="" href="http://mypage" target="_blank">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/



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 ""



Kfir
 

Thread Tools




All times are GMT. The time now is 11:42 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org