diff options
author | Zhao Lei <zhaolei@cn.fujitsu.com> | 2015-09-23 18:44:33 +0800 |
---|---|---|
committer | Zhao Lei <zhaolei@cn.fujitsu.com> | 2015-09-23 18:44:33 +0800 |
commit | aac30bf211753ea17871ef80bfa3285c5a5ec08f (patch) | |
tree | f2dcf48e2ad21c1d1110a82bfb9f2c3883b6b53e | |
parent | 19831ce56a14b37751694a6ba5e97f6a6e2f1b40 (diff) | |
download | oslo-incubator-aac30bf211753ea17871ef80bfa3285c5a5ec08f.tar.gz |
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: I3c87987d3b992c8363ef236a04ae6e35c1315535
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
-rwxr-xr-x | tools/filter_git_history.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/filter_git_history.sh b/tools/filter_git_history.sh index 79e90aab..1336b5c0 100755 --- a/tools/filter_git_history.sh +++ b/tools/filter_git_history.sh @@ -24,7 +24,7 @@ pruner="git ls-files | grep -v \"$keep_pattern\" | git update-index --force-remo roots="" for file in $files_to_keep; do - file_root="$(git rev-list --reverse HEAD -- $file | head -n1)" + file_root=$(git rev-list --reverse HEAD -- $file | head -n1) fail=0 for root in $roots; do if git merge-base --is-ancestor $root $file_root; then |