No need to add quotes for a subshell call in bash script

Bug #1499716 reported by Zhao Lei
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
kolla
Fix Released
Wishlist
Zhao Lei

Bug Description

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
 #

Based on above viewpoint, we can remove quotes in following files:
 docker/ceph/ceph-mon/start.sh
 docker/ceph/ceph-osd/start.sh

Zhao Lei (zhaolei-0)
Changed in kolla:
assignee: nobody → Zhao Lei (zhaolei-0)
Changed in kolla:
status: New → In Progress
Sam Yaple (s8m)
Changed in kolla:
milestone: none → liberty-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla (master)

Reviewed: https://review.openstack.org/226734
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=c62ddbfa977fbf27bbf1241bf20e9e1835212197
Submitter: Jenkins
Branch: master

commit c62ddbfa977fbf27bbf1241bf20e9e1835212197
Author: Zhao Lei <email address hidden>
Date: Fri Sep 25 20:36:31 2015 +0800

    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 <email address hidden>

Changed in kolla:
status: In Progress → Fix Committed
Steven Dake (sdake)
Changed in kolla:
importance: Undecided → Wishlist
Sam Yaple (s8m)
Changed in kolla:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.