View Single Post
  #5   (View Single Post)  
Old 23rd September 2010
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,546
Default

In the context of Bourne shell scripting:

For all practical intents and purposes, $(string) is just a synonym for `string`. $() was added as a more explicit way of doing `` around the 80s, so $() is not as portable as ``.

I have not seen any shell that does not support $(), that is not old as petrified dog poo. I personally use `` in scripts because it gains a small bit of portability at no sacrifice in readability over $(). Yes, I'm to lazy to change from ``to $() in case I get stuck in an antique sh.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote