Re: Curious bash evaluation

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

 



On Mon, Dec 27, 2010 at 10:51 PM, Rodolfo Alcazar Portillo
<nospaze@xxxxxxxxx> wrote:
> On Mon, 2010-12-27 at 13:31 -0500, Chris Tyler wrote:
>> On Mon, 2010-12-27 at 17:05 +0100, Rodolfo Alcazar Portillo wrote:
>> > Hello. See this:
>> >
>> > # A="echo 'hi'"
>> >
>> > # echo $($A)
>> > 'hi'
>> >
>> > # echo 'hi'
>> > hi
>> >
>> > Does anyone understand why does the first command
>> > evals the echo but echoes the simple quotes?
>>
>> $() provides a type of quoting, so it's evaluated similar to:
>>
>>    "echo" "'hi'"
>>
>> which produces the observed result.
>
> Hmmm. Somehow obvious. Is that "type of quoting" documented
> somewhere? Why does it eval just the first word?

While I don't agree with the above characterization the process is
documented in the EXPANSION section of the bash manpage.

John
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux