From c0406501f0b4295a9917d31574baa2e462a18799 Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Sat, 2 Sep 2017 06:50:50 -0400 Subject: scripts: mount.glusterfs contains non-portable bashisms Debian's default shell is dash, i.e. /bin/sh -> dash, which doesn't support bash extensions Reported-by: "Michael Lundkvist" Reported-by: pmatthaei@debian.org Debian BZ: 873878 Change-Id: I33003183b9bc6459cae28c565125e6b2bd1eaa47 BUG: 1487830 Signed-off-by: Kaleb S. KEITHLEY Reviewed-on: https://review.gluster.org/18184 Reviewed-by: Niels de Vos Tested-by: Niels de Vos Smoke: Gluster Build System CentOS-regression: Gluster Build System --- xlators/mount/fuse/utils/mount.glusterfs.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in index 216d03c4182..ea7205b95e2 100755 --- a/xlators/mount/fuse/utils/mount.glusterfs.in +++ b/xlators/mount/fuse/utils/mount.glusterfs.in @@ -673,8 +673,9 @@ main () [ -n "$volume_str" ] && { volume_id=$volume_str volume_str_temp=$volume_str - [ ${volume_str:0:1} = '/' ] && { - volume_str_temp=${volume_str:1} + first_char=$(echo "$volume_str" | cut -c 1) + [ ${first_char} = '/' ] && { + volume_str_temp=$(echo "$volume_str" | cut -c 2-) } [ $(echo $volume_str_temp | grep -c "/") -eq 1 ] && { volume_id=$(echo "$volume_str_temp" | cut -f1 -d '/'); -- cgit