cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Fri, 21 Sep 2007 09:16:27 -0500

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