cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Post www-urlencoded data

From: What you get is Not what you see <wyginwys_at_gmail.com>
Date: Tue, 26 Feb 2008 09:11:41 +0200

>
> > I
> > think,know that this must
> > be removed. Therefore I use commands (before urlencoding) like
> > tr -d "\015" < foobar > foobar2
> > tr -d "\n" < foobar2 > foobar3
> > tr -d "^M" <foobar3 > foobar4
> > for removing newlines and ^M's from the variable.
> > Is this correct?
>
> Those command lines can work, depending on your shell and system sure, but
> iirc the backslashes should either be doubled or you need to use single-quotes
> on several systems/shells. Or you replace the three tr invokes with a single
> sed line:
>
> sed -i -e 's/[\r\n]//g' file
>
> (-i being a GNU sed fancy option)
This sed command removes ^M chars but \n chars still stay.
I needed to remove them by tr -d "\n" .

I understood where my problem is. It was about the viewstate variable extraction
from html. Somehow I wrote the correct code and now my script does its job.
<input type="hidden" name="__VIEWSTATE" value="value" />
How can I extract the value from such an html line?
Received on 2008-02-26