Script style: ` or $()?
Jason Hellenthal
jhellenthal at dataix.net
Fri Jun 1 04:15:53 UTC 2012
On Thu, May 31, 2012 at 06:49:54PM -0700, Doug Barton wrote:
> On 5/31/2012 2:29 PM, Chris Rees wrote:
> > Seems that either no preference or $() is the rule,
>
> I not only wouldn't say that, I didn't when I responded previously. :)
>
> > but if you're
> > documenting a code example that is designed to be copy/pasted to a
> > shell then you should use `` -- otherwise you make life very difficult
> > for t?csh users.
>
> Valid point, except that he specified that he is writing an rc.d script
> (which makes sense considering the list ...).
>
Writing code to be copy and pasted is a bad idea anyway. It just invites
unsuspecting users that do not understand what ramifications can come
from running code they don't understand. A simple slip of the mouse
could cause someone great grief. Lets not forget too... some
terminals/web browsers and other forms of text transportation can copy
in different ways, inserting control characters that you don't see the
results before running. But this is an rc.d example soooo $() should be
fine as its reccomended more often than not.
--
- (2^(N-1))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20120601/c0563107/attachment.pgp
More information about the freebsd-rc
mailing list