No need to add quotes for a subshell call in bash script
Bug #1499716 reported by
Zhao Lei
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/
docker/
Changed in kolla: | |
assignee: | nobody → Zhao Lei (zhaolei-0) |
Changed in kolla: | |
status: | New → In Progress |
Changed in kolla: | |
milestone: | none → liberty-rc1 |
Changed in kolla: | |
importance: | Undecided → Wishlist |
Changed in kolla: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Reviewed: https:/ /review. openstack. org/226734 /git.openstack. org/cgit/ openstack/ kolla/commit/ ?id=c62ddbfa977 fbf27bbf1241bf2 0e9e1835212197
Committed: https:/
Submitter: Jenkins
Branch: master
commit c62ddbfa977fbf2 7bbf1241bf20e9e 1835212197
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: I06520f4b11ea6b 56c4e73049b6f38 bfc62fe1392
Closes-Bug: #1499716
Signed-off-by: Zhao Lei <email address hidden>