bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: weird problem -- path interpretted/eval'd as numeric expression


From: Pierre Gaston
Subject: Re: weird problem -- path interpretted/eval'd as numeric expression
Date: Fri, 29 Mar 2013 17:23:12 +0200

On Fri, Mar 29, 2013 at 5:10 PM, John Kearney <address@hidden> wrote:
> consider
> address@hidden ~
> $ read -ra vals -d '' <<< $'lkjlksda\n adasd\n:sdasda:'
>
> address@hidden ~
> $ echo ${vals[0]}
> lkjlksda
>
> I meant to update your wiki about it but I forgot.
> I guess read uses gets not fread and that truncates the line anyway.
>
you miss the IFS part:
IFS=: read -ra vals -d '' <<< $'lkjlksda\n adasd\n:sdasda:'
echo "${vals[0]}"

(IFS contains \n by default)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]