[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] What is : good for
From: |
Eric Blake |
Subject: |
Re: [Help-bash] What is : good for |
Date: |
Fri, 19 Feb 2016 15:40:01 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 |
On 02/19/2016 03:19 PM, Greg Wooledge wrote:
> "Performing redirections" is probably for something like this:
>
> : >file_i_want_truncated
>
> Which of course is equivalent to:
>
>> file_i_want_truncated
They are equivalent at the top level, but according to POSIX, they are
NOT equivalent in a subshell:
$(>file_i_want_truncated) is undefined in POSIX, while $(:
>file_i_want_truncated) is well-defined.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature