Remove quotes from subshell call in bash script

Always no quotes for $() statement.

We don't need quotes to hold blanks in result:
 # i=$(echo 1 2 3)
 # echo $i
 1 2 3
 #

These quotes can make something wrong in some case:
 # i=$(echo '!')
 #
 # i="$(echo '!')"
 -bash: !: event not found
 #

No real problem for current code, only to use a better code style.

Change-Id: I06520f4b11ea6b56c4e73049b6f38bfc62fe1392
Closes-Bug: #1499716
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
This commit is contained in:
Zhao Lei 2015-09-25 20:36:31 +08:00
parent 0f297ed0ee
commit c62ddbfa97
2 changed files with 4 additions and 4 deletions
docker/ceph
ceph-mon
ceph-osd

@ -21,7 +21,7 @@ set_configs
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
# Lookup our fsid from the ceph.conf
FSID="$(awk '/^fsid/ {print $3; exit}' /etc/ceph/ceph.conf)"
FSID=$(awk '/^fsid/ {print $3; exit}' /etc/ceph/ceph.conf)
# Generating initial keyrings and monmap
ceph-authtool --create-keyring "${KEYRING_MON}" --gen-key -n mon. --cap mon 'allow *'

@ -21,10 +21,10 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
partprobe || true
# We look up the appropriate device path with partition.
OSD_PARTITION="$(ls ${OSD_DEV}* | egrep ${OSD_DEV}p?1)"
OSD_PARTITION=$(ls "${OSD_DEV}"* | egrep "${OSD_DEV}p?1")
JOURNAL_PARTITION="${OSD_PARTITION%?}2"
OSD_ID="$(ceph osd create)"
OSD_ID=$(ceph osd create)
OSD_DIR="/var/lib/ceph/osd/ceph-${OSD_ID}"
mkdir -p "${OSD_DIR}"
mkfs.xfs -f "${OSD_PARTITION}"
@ -47,7 +47,7 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
fi
# We look up the appropriate journal since we cannot rely on symlinks
JOURNAL_PARTITION="$(ls ${OSD_DEV}* | egrep ${OSD_DEV}p?2)"
JOURNAL_PARTITION=$(ls "${OSD_DEV}"* | egrep "${OSD_DEV}p?2")
OSD_DIR="/var/lib/ceph/osd/ceph-${OSD_ID}"
CMD="/usr/bin/ceph-osd"
ARGS="-f -d -i ${OSD_ID} --osd-journal ${JOURNAL_PARTITION} -k ${OSD_DIR}/keyring"