Re: [dev] [sw] Suckless web-framework

From: Florian Ermisch <floh.edo_AT_googlemail.com>
Date: Thu, 08 Apr 2010 13:05:51 +0200

Am 07.04.10 07:25, schrieb pancake:
> 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
Well, in ksh93 and bash 4.0 on OpenSolaris build 134, ksh and bash 3.0
on solaris 10 and ksh and bash 2.0 on solaris 9 both merge all lines
("echo `echo; echo $0; echo`" vs "echo $(echo; echo $0; echo)")
>
> On Apr 7, 2010, at 4:01 AM, Noah Birnel <nbirnel_AT_gmail.com> wrote:
>
>> On Sun, Apr 04, 2010 at 01:03:55PM -0400, node_AT_lavabit.com wrote:
>>
>>> Semi unrelated question: why are so many people at suckless using ` `
>>> instead of $( ) ? I've seen it here, dmenu_path, surf's config.h... etc.
>>>
>>> $( ) only fails in very, very old shells... think original bourne
I was told $( ) was originally a Korn Shell feature which was adapted by
the other bourne-supersets. If /bin/sh cannot process such a superset
the script will fail.
>>
>> I use backticks out of habit... and maybe ignorance. Can you explain
>> your preference?

Mine would be
1. easier to read and
2. for the realy evil stuff the $( )s can be nested:
~$ echo $( echo $( echo 123 | rev ) | rev )
123
~$ echo ` echo ` echo 123 | rev ` | rev `
/bin/ksh: syntax error: `|' unexpected

>>
>> --Noah
>>
>

regards, Florian
Received on Thu Apr 08 2010 - 11:05:51 UTC

This archive was generated by hypermail 2.2.0 : Thu Apr 08 2010 - 11:12:02 UTC