浏览代码

Apply proper alignment within subshells

Alois Mahdal 3 年前
父节点
当前提交
bdd37f2d40
共有 1 个文件被更改,包括 10 次插入6 次删除
  1. 10
    6
      99bottles.sh

+ 10
- 6
99bottles.sh 查看文件

@@ -110,13 +110,17 @@ grammar() {
110 110
     while read line; do
111 111
         line="${line/one more bottles/one more bottle}"
112 112
         case "$line" in
113
-            *"one of those bottles"*)   line="$([ $oneBottle = true ] &&
114
-                                        echo ${line/one of those bottles/that lone bottle} ||
115
-                                        echo $line )"
113
+            *"one of those bottles"*)   line="$(
114
+                                            [ $oneBottle = true ] \
115
+                                             && echo ${line/one of those bottles/that lone bottle} \
116
+                                             || echo $line
117
+                                        )"
116 118
                                         ;;
117
-            *"one down"*)               line="$([ $oneBottle = true ] &&
118
-                                        echo ${line/one down/it down} ||
119
-                                        echo $line )"
119
+            *"one down"*)               line="$(
120
+                                            [ $oneBottle = true ] \
121
+                                             && echo ${line/one down/it down} \
122
+                                             || echo $line
123
+                                        )"
120 124
                                         ;;
121 125
             *bottles*)                  oneBottle=false;;
122 126
             *bottle*)                   oneBottle=true;;