accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Drob (JIRA)" <>
Subject [jira] [Commented] (ACCUMULO-2423) Converge Shell scripts on single implementation
Date Wed, 05 Mar 2014 18:04:43 GMT


Mike Drob commented on ACCUMULO-2423:

If you're using bash, then there is no reason to not use \[\[. The main difference is that
\[\[ handles word splitting and empty strings better than \[. Example:

mdrob@mdrob-W530:~$ echo $X

mdrob@mdrob-W530:~$ [[ "" = $X ]] && echo true || echo false
mdrob@mdrob-W530:~$ [ "" = $X ] && echo true || echo false
bash: [: : unary operator expected

Regarding = or ==, I personally prefer == because it matches with the numeric equality check
in ((..)). Using = is fine though, I don't have a strong argument there.

> Converge Shell scripts on single implementation
> -----------------------------------------------
>                 Key: ACCUMULO-2423
>                 URL:
>             Project: Accumulo
>          Issue Type: Improvement
>    Affects Versions: 1.6.0
>            Reporter: Mike Drob
>         Attachments: ACCUMULO-2423.v1.patch.txt
> Do we want to have a stated dependency on a particular shell? Most of our scripts explicitly
use bash, but some use sh. Most scripts invoke {{#\!/usr/bin/env bash}} but some do {{#\!/bin/bash}}
or other crazy things.
> I don't have a particular preference which way we go, but I'd like to see us standardize
one way or the other.
> If we use {{/bin/sh}}, then we can run everything through the [checkbashisms|]
script (also available for other distros)
> If we go the other way, and switch everything to bash, then we can run them through {{ksh
-n}} for deprecation warnings. I know that's a different shell, but they're still moderately

This message was sent by Atlassian JIRA

View raw message