On Apr 7, 2010, at 4:01 AM, Noah Birnel <nbir...@gmail.com> wrote:
> I use backticks out of habit... and maybe ignorance. Can you explain
> your preference?

They are confusing:

 echo $( echo $( echo $( echo str ) ) )

 echo ` echo \` echo \\\` echo str \\\` \` `

 echo $( echo \\ )

 echo ` echo \\\ `

Backticks are also easily mistaken for single quotes and not readily
avaiable on intl. keyboards.

On Wed, April 7, 2010 1:25 am, "pancake" <panc...@youterm.com> wrote:
> Is not the same... Backticks keeps newlines, but $() merges all lines
> into a single one. I'm not sure if this behaviour is affected by IFS

Not sure what you mean by this, or maybe it's shell dependant.

Both print the same:

 dash -c 'echo "$(printf %s\\n str str2)"'
 dash -c 'echo "`printf %s\\\n str str2`"'

And testing with literal newlines also works:

 dash -c 'echo "$(printf %s\\n "new
line")"'

 dash -c 'echo "`printf %s\\\n \"new
line\"`"'





Reply via email to