Re: simple question
- From: "Chris F.A. Johnson" <cfajohnson@xxxxxxxxx>
- Date: Thu, 21 Jun 2007 03:53:52 -0400
On 2007-06-21, Carbon wrote:
On Wed, 20 Jun 2007 23:38:13 +0000, DanceRat wrote:
What's the difference between $(cat $1) and `cat $1` ?
Quoting is simpler with $() style command substitution. You have to escape
backslashes when using `` syntax. And when nesting commands you have to
escape the inner quotes with backslashes. It can get tricky. I always use
the newer $() form.
Btw you can just do $(< $1) instead of $(cat $1).
Only with some shells (bash, ksh93), yes. It is not standard.
--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell/>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
.
- Follow-Ups:
- Re: simple question
- From: Joachim Schmitz
- Re: simple question
- References:
- simple question
- From: DanceRat
- Re: simple question
- From: Carbon
- simple question
- Prev by Date: Re: difference between `` and $()
- Next by Date: Re: simple question
- Previous by thread: Re: simple question
- Next by thread: Re: simple question
- Index(es):
Relevant Pages
|