help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Understanding read -r


From: Eric Blake
Subject: Re: [Help-bash] Understanding read -r
Date: Thu, 04 Oct 2012 17:25:55 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1

On 10/04/2012 05:16 PM, Bob Proulx wrote:

>> { var=$(</dev/stdin); } <<EOF

> 
> I personally dislike the use of /dev/stdin and the others because they
> are non-portable across kernels and cause me trouble.

Bash special-cases /dev/stdin so that it works even if your kernel
doesn't support it.  Of course, that special casing is only applicable
to situations where bash is opening the file, and not where you pass the
string '/dev/stdin/ as an argument to some other program, so I tend to
agree with your analysis that it gets even harder to use when it works
in some, but not all, contexts within the same machine.

>> var=<<EOF
>> ...
>> EOF
>>
>> This is optimized to happen in memory with no temporary file.
> 
> Looks like a nice feature.

How is it any different from:
var="...
"

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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