SPUG:Here documents

William Julien moonbeam at catmanor.com
Sat May 3 12:13:20 CDT 2003


>
>P.S. It's a technique I created adopted from a practice I had for
>shell scripts. In shell scripts, I used stdout in the function
>(subroutine) and command substitution in the main body.  Note, that
>most folks still don't know that $(...) is a better (and newer) syntax
>for backticks, `...`, even though it's not so new any more.  I like it
>because it's easier to see.  It also nests better, though I don't tend
>to nest them except to bend the brains of students in my class to show
>them how beautiful they really can become.  Additionally, the dollar
>sign becomes "value of" in *two* contexts, makeing them easier to
>rember because of the network effect.

This may be a bit off topic, but I use the $(...) quite a bit, but
mostly as a replacement of the var=`command` syntax. for example:

-->date
Sat May  3 10:07:09 PDT 2003
-->yesterday=$(TZ=GMT+32;date)
-->echo $yesterday    
Fri May 2 09:07:15 GMT 2003

William



More information about the spug-list mailing list