Backport the :end-of-capability fix
[emacs.git] / test / indent / shell.sh
blob14f67744ff2565c27079c8ef4adfe5c14e0f1342
1 #!/bin/sh
2 # -*- eval: (bug-reference-mode 1) -*-
4 setlock -n /tmp/getmail.lock && echo getmail isn\'t running
6 # adsgsdg
8 if foo; then
9 if bar; then
10 toto
12 fi # bug#15613
14 case $X in
15 foo)
16 do_something
18 arg=*) # bug#12953
19 do_something_else_based_on_arg
22 default
24 esac
26 { # bug#17621
27 foo1 &&
28 foo2 &&
29 bar
31 foo1 && \
32 foo2 && \
33 bar
36 for foo in bar; do # bug#17721
37 [ -e $foo ] && {
38 echo t
39 } && {
40 echo r
42 done
44 for foo in bar; do # bug#17896
45 [ -e $foo ] && [ -e $bar ] && {
46 echo just fine thanks
48 done
50 filter_3 () # bug#17842
52 tr -d '"`' | tr ' ' ' ' | \
53 awk -F\; -f filter.awk | \
54 grep -v "^," | sort -t, -k2,2
57 foo | bar | {
58 toto
61 grep -e "^$userregexp:" /etc/passwd | cut -d : -f 1 | while read user ; do
62 print -u2 "user=$user" # bug#18031
63 sudo -U $user -ll | while read line ; do
65 done
66 done
68 echo -n $(( 5 << 2 ))
69 # This should not be treated as a heredoc (bug#12770).
72 foo='bar<<' # bug#11263
73 echo ${foo%<<aa} # bug#11263
74 echo $((1<<8)) # bug#11263
75 echo $[1<<8] # bug#11263
77 declare -a VERSION
78 for i in $(ls "$PREFIX/sbin") ; do
79 echo -e $N')' $i
80 VERSION[${#VERSION[*]}]=$i # bug#11946.
81 N=$(($N + 1))
82 done
84 foo () {
86 bar () {
87 blilbi
90 case toto
91 in a) hello # KNOWN INDENT BUG
92 ;; b) hi # KNOWN INDENT BUG
93 ;; c) hi # KNOWN INDENT BUG
94 esac
96 case $toto in
97 a) echo 1;; b) echo 2;;
98 (c)
99 echo 3;;
101 echo 3;;
102 esac
104 case $as_nl`(ac_space=' '; set) 2>&1` in #(
105 *${as_nl}ac_space=\ *)
106 # `set' does not quote correctly, so add quotes: double-quote
107 # substitution turns \\\\ into \\, and sed turns \\ into \.
108 sed -n \
109 "s/'/'\\\\''/g;
110 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=/\\1=''/p"
111 ;; #(
113 # `set' quotes correctly as required by POSIX, so do not add
114 # quotes.
115 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
117 esac |
118 grep '.' | # KNOWN INDENT BUG
119 sed 1d
121 case toto in
122 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
123 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* \
124 | --exec=* | --exe=* | --ex=*)
125 exec_prefix=$ac_optarg ;;
127 hello ;;
128 3) hello $(adfad)
129 echo esac ;; # KNOWN INDENT BUG
130 5) hello ;;
131 4) hello ;&
132 4) hello ;;&
133 5) hello ;;
134 5) hello ;;
135 esac
137 echo "'" wfgfe
139 #!/bin/bash
140 cat << EOF \
141 | cat sadfsafd \
142 sadfsafd "KNOWN INDENT BUG" \
143 | tee -a bug.txt
144 asdfsaf
145 This is a test case for a bug in bash shell mode text highlighting
148 cat <<EOF1 <<EOF2 # KNOWN INDENT BUG
149 help1
150 EOF1
151 help2
152 EOF2
154 bar () {
155 if [ $# == 0 ]; then
156 while
157 f # KNOWN INDENT BUG
159 bla;
160 done
161 echo "Highlighting is screwed up now"
162 if [ 1 = 1 ]; then
163 # adsgsdg
164 echo "screwed up"
167 $@ $? $#
169 for f in *
171 sdfg
172 done
174 if swrgfef
175 then blas
176 else sdf