cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Linux: curl command doesnt like the use of ${} in bash.

From: <paroxsitic_at_gmail.com>
Date: Fri, 21 Sep 2007 10:31:49 -0400

I still can't get it to work. There was never a \r at the end to begin
with. I confused the \n of the echo command and thought there was a
\n.

while read line
do
        textArray[c]=$line
        echo "${textArray[c]} test ${textArray[c]}"
        c=$(expr $c + 1) # increase counter by 1
done < $FILE

Show that there is no return/newline after test in the echo.

On 9/21/07, Ralph Mitchell <ralphmitchell_at_gmail.com> wrote:
> On 9/21/07, paroxsitic_at_gmail.com <paroxsitic_at_gmail.com> wrote:
> > You were correct. I was just finding that out when I got the email. I
> > read the IDs from a file.
> > I have stripped the \n this way:
> >
> > while read line
> > do
> > textArray[c]=$(echo $line | sed "s/\n//") # store line
> > c=$(expr $c + 1) # increase counter by 1
> > done < $FILE
> >
> > It seems slow, do you suggest a faster way to strip \n?
> >
>
> You could try "tr -d '\r\n'" instead of sed. That's a smaller binary
> and it's designed to just translate/delete characters. Sed does all
> kinds of other stuff as well.
>
> Ralph Mitchell
>
Received on 2007-09-21