Re: Curious bash evaluation

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

 



On Mon, 2010-12-27 at 10:46 -0600, inode0 wrote:
> On Mon, Dec 27, 2010 at 10:05 AM, Rodolfo Alcazar Portillo
> <nospaze@xxxxxxxxx> wrote:
> > Hello. See this:
> >
> > # A="echo 'hi'"
> >
> > # echo $($A)
> > 'hi'
> 
> That seems rather convoluted. Are you sure you don't just want to
> "eval $A" anyway?

Very sure. Not "bash", nor "eval". Just simple command substitution.
Another reason: it's shorter. Another reason: It must be understood, not
just avoided in a micro$oft software fashion.

> I realize your example may be a simple abstraction of something more complex.

Of course. I'm building a short script from some string. The rest is
boring.

Another failing example:
> cat script 
echo "hello"

> $(<script)
"hello"

The $(<file) form is documented in the manual:
http://www.faqs.org/docs/bashman/bashref_30.html

Thanks!
-- 
----------------------------------------------
Rodolfo Alcazar Portillo - nospaze@xxxxxxxxx
otbits.blogspot.com / counter.li.org: #367962
----------------------------------------------
Q. What's the difference between Batman and Bill Gates?
A. When Batman fought the Penguin, he won.


-- 
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