]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
generate_group_vars_sample: do not use expr
authorSébastien Han <seb@redhat.com>
Mon, 15 May 2017 08:56:33 +0000 (10:56 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 17 May 2017 13:37:24 +0000 (15:37 +0200)
As mentionned in https://github.com/koalaman/shellcheck/wiki/SC2003
expr is antiquated.

Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 53be0980be65170bb4f2acb3c87b0c1eff8c7acb)
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
generate_group_vars_sample.sh

index c238d8cda2314dd2017aa81703cb704d34479a2c..e42253858297c518802a885155cbfe59f840ab2d 100755 (executable)
@@ -36,7 +36,7 @@ EOF
     sed '/^---/d; s/^\([A-Za-z[:space:]]\)/#\1/' \
       "$defaults" >> "$basedir"/group_vars/"$output"
     echo >> "$basedir"/group_vars/"$output"
-  elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
+  elif [ "$(uname -s)" == "Linux" ]; then
     sed '/^---/d; s/^\([A-Za-z[:space:]].\+\)/#\1/' \
       "$defaults" >> "$basedir"/group_vars/"$output"
     echo >> "$basedir"/group_vars/"$output"