You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by Felix Schumacher <fe...@internetallee.de> on 2017/11/04 19:43:03 UTC

Usage of $(...) instead of `...` in shell scripts

Hi all,

we have both forms of execution commands in our shell scripts.

$(...) is the more modern form and should be preferred over `...` as
explained on https://github.com/koalaman/shellcheck/wiki/SC2006

Does anyone know, if there is a reason for using the old form `...` in
our scripts?

Regards,
 Felix

Re: Usage of $(...) instead of `...` in shell scripts

Posted by Felix Schumacher <fe...@internetallee.de>.

Am 6. November 2017 19:27:47 MEZ schrieb sebb <se...@gmail.com>:
>On 6 November 2017 at 18:20, Felix Schumacher
><fe...@internetallee.de> wrote:
>>
>>
>> Am 6. November 2017 19:04:41 MEZ schrieb sebb <se...@gmail.com>:
>>>The $() syntax is newer than the command files.
>>>i.e. it was not available when they were written.
>>
>> That's probably true. To be more specific: I would like to know,
>whether it is safe to change it.
>>
>> Do you know of any system, that has a default shell, that is not able
>to process $(..)?
>
>If there is any doubt, just leave it alone.
>
>It's not broken, so don't try to fix it ...

Well actually there is one bug still left that is related to quoting and spaces in variables (path). 

It can be fixed with the old syntax, but I am still curious if there are any systems left, that can work with the old expression, only. 

Regards, 
Felix 
>
>> Regards,
>> Felix
>>
>>>
>>>On 4 November 2017 at 22:58, Philippe Mouawad
>>><ph...@gmail.com> wrote:
>>>> No idea why it’s like this
>>>>
>>>> On Saturday, November 4, 2017, Felix Schumacher <
>>>> felix.schumacher@internetallee.de> wrote:
>>>>
>>>>> Hi all,
>>>>>
>>>>> we have both forms of execution commands in our shell scripts.
>>>>>
>>>>> $(...) is the more modern form and should be preferred over `...`
>as
>>>>> explained on https://github.com/koalaman/shellcheck/wiki/SC2006
>>>>>
>>>>> Does anyone know, if there is a reason for using the old form
>`...`
>>>in
>>>>> our scripts?
>>>>>
>>>>> Regards,
>>>>>  Felix
>>>>>
>>>>
>>>>
>>>> --
>>>> Cordialement.
>>>> Philippe Mouawad.

Re: Usage of $(...) instead of `...` in shell scripts

Posted by sebb <se...@gmail.com>.
On 6 November 2017 at 18:20, Felix Schumacher
<fe...@internetallee.de> wrote:
>
>
> Am 6. November 2017 19:04:41 MEZ schrieb sebb <se...@gmail.com>:
>>The $() syntax is newer than the command files.
>>i.e. it was not available when they were written.
>
> That's probably true. To be more specific: I would like to know, whether it is safe to change it.
>
> Do you know of any system, that has a default shell, that is not able to process $(..)?

If there is any doubt, just leave it alone.

It's not broken, so don't try to fix it ...

> Regards,
> Felix
>
>>
>>On 4 November 2017 at 22:58, Philippe Mouawad
>><ph...@gmail.com> wrote:
>>> No idea why it’s like this
>>>
>>> On Saturday, November 4, 2017, Felix Schumacher <
>>> felix.schumacher@internetallee.de> wrote:
>>>
>>>> Hi all,
>>>>
>>>> we have both forms of execution commands in our shell scripts.
>>>>
>>>> $(...) is the more modern form and should be preferred over `...` as
>>>> explained on https://github.com/koalaman/shellcheck/wiki/SC2006
>>>>
>>>> Does anyone know, if there is a reason for using the old form `...`
>>in
>>>> our scripts?
>>>>
>>>> Regards,
>>>>  Felix
>>>>
>>>
>>>
>>> --
>>> Cordialement.
>>> Philippe Mouawad.

Re: Usage of $(...) instead of `...` in shell scripts

Posted by Felix Schumacher <fe...@internetallee.de>.

Am 6. November 2017 19:04:41 MEZ schrieb sebb <se...@gmail.com>:
>The $() syntax is newer than the command files.
>i.e. it was not available when they were written.

That's probably true. To be more specific: I would like to know, whether it is safe to change it. 

Do you know of any system, that has a default shell, that is not able to process $(..)? 

Regards, 
Felix 

>
>On 4 November 2017 at 22:58, Philippe Mouawad
><ph...@gmail.com> wrote:
>> No idea why it’s like this
>>
>> On Saturday, November 4, 2017, Felix Schumacher <
>> felix.schumacher@internetallee.de> wrote:
>>
>>> Hi all,
>>>
>>> we have both forms of execution commands in our shell scripts.
>>>
>>> $(...) is the more modern form and should be preferred over `...` as
>>> explained on https://github.com/koalaman/shellcheck/wiki/SC2006
>>>
>>> Does anyone know, if there is a reason for using the old form `...`
>in
>>> our scripts?
>>>
>>> Regards,
>>>  Felix
>>>
>>
>>
>> --
>> Cordialement.
>> Philippe Mouawad.

Re: Usage of $(...) instead of `...` in shell scripts

Posted by sebb <se...@gmail.com>.
The $() syntax is newer than the command files.
i.e. it was not available when they were written.

On 4 November 2017 at 22:58, Philippe Mouawad
<ph...@gmail.com> wrote:
> No idea why it’s like this
>
> On Saturday, November 4, 2017, Felix Schumacher <
> felix.schumacher@internetallee.de> wrote:
>
>> Hi all,
>>
>> we have both forms of execution commands in our shell scripts.
>>
>> $(...) is the more modern form and should be preferred over `...` as
>> explained on https://github.com/koalaman/shellcheck/wiki/SC2006
>>
>> Does anyone know, if there is a reason for using the old form `...` in
>> our scripts?
>>
>> Regards,
>>  Felix
>>
>
>
> --
> Cordialement.
> Philippe Mouawad.

Re: Usage of $(...) instead of `...` in shell scripts

Posted by Philippe Mouawad <ph...@gmail.com>.
No idea why it’s like this

On Saturday, November 4, 2017, Felix Schumacher <
felix.schumacher@internetallee.de> wrote:

> Hi all,
>
> we have both forms of execution commands in our shell scripts.
>
> $(...) is the more modern form and should be preferred over `...` as
> explained on https://github.com/koalaman/shellcheck/wiki/SC2006
>
> Does anyone know, if there is a reason for using the old form `...` in
> our scripts?
>
> Regards,
>  Felix
>


-- 
Cordialement.
Philippe Mouawad.