* lisp/progmodes/sh-script.el (sh-smie-sh-rules): Use same rule for && as
[bpt/emacs.git] / test / indent / shell.sh
index 26a01dc..74985a4 100755 (executable)
@@ -1,9 +1,50 @@
 #!/bin/sh
+# -*- eval: (bug-reference-mode 1) -*-
 
 setlock -n /tmp/getmail.lock && echo getmail isn\'t running
 
 # adsgsdg
 
+if foo; then
+    if bar; then
+       toto
+    fi
+fi                              # bug#15613
+
+case $X in
+    foo)
+        do_something
+        ;;
+    arg=*)                     # bug#12953
+        do_something_else_based_on_arg
+        ;;
+    *)
+        default
+        ;;
+esac
+
+{                              # bug#17621
+    foo1 &&
+        foo2 &&
+        bar
+}
+
+echo -n $(( 5 << 2 ))
+# This should not be treated as a heredoc (bug#12770).
+2
+
+foo='bar<<'                     # bug#11263
+echo ${foo%<<aa}                # bug#11263
+echo $((1<<8))                  # bug#11263
+echo $[1<<8]                    # bug#11263
+
+declare -a VERSION
+for i in $(ls "$PREFIX/sbin") ; do
+    echo -e $N')' $i
+    VERSION[${#VERSION[*]}]=$i  # bug#11946.
+    N=$(($N + 1))
+done
+
 foo () {
 
     bar () {
@@ -18,7 +59,10 @@ foo () {
 
     case $toto in
         a) echo 1;; b) echo 2;;
-        c) echo 3;;
+        (c)
+            echo 3;;
+        d)
+            echo 3;;
     esac
     
     case $as_nl`(ac_space=' '; set) 2>&1` in #(