Re: Non-POSIX shells



On Tue, Mar 05, 2002 at 09:47:26PM +0000, Sander Vesik wrote:
> I don't know. Does it? The part in posix that talks about parameter
> expansion definately has curly braces not parentsesis following the $

	$() is not ${}, it is ``.  IOW, $() is a readable version of
command substitution.  To it:

FOO="`host \'$1\'`"

vs

FOO="$(host \'$1\')"

	IMHO, the latter is more readable.  However, the former is more
portable.  $() will work in bash, ksh, and ash.  It will work in a
strict POSIX.2 shell.  It will not in sh on some systems (Solaris being
an example).

Joel

-- 

"Always give your best, never get discouraged, never be petty; always
 remember, others may hate you.  Those who hate you don't win unless
 you hate them.  And then you destroy yourself."
	- Richard M. Nixon

			http://www.jlbec.org/
			jlbec evilplan org



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