]> code.delx.au - gnu-emacs/blob - test/indent/shell.sh
; Auto-commit of ChangeLog files.
[gnu-emacs] / test / indent / shell.sh
1 #!/bin/sh
2 # -*- eval: (bug-reference-mode 1) -*-
3
4 setlock -n /tmp/getmail.lock && echo getmail isn\'t running
5
6 # adsgsdg
7
8 if foo; then
9 if bar; then
10 toto
11 fi
12 fi # bug#15613
13
14 case $X in
15 foo)
16 do_something
17 ;;
18 arg=*) # bug#12953
19 do_something_else_based_on_arg
20 ;;
21 *)
22 default
23 ;;
24 esac
25
26 { # bug#17621
27 foo1 &&
28 foo2 &&
29 bar
30
31 foo1 && \
32 foo2 && \
33 bar
34 }
35
36 for foo in bar; do # bug#17721
37 [ -e $foo ] && {
38 echo t
39 } && {
40 echo r
41 }
42 done
43
44 for foo in bar; do # bug#17896
45 [ -e $foo ] && [ -e $bar ] && {
46 echo just fine thanks
47 }
48 done
49
50 filter_3 () # bug#17842
51 {
52 tr -d '"`' | tr ' ' ' ' | \
53 awk -F\; -f filter.awk | \
54 grep -v "^," | sort -t, -k2,2
55 }
56
57 foo | bar | {
58 toto
59 }
60
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
64 :
65 done
66 done
67
68 echo -n $(( 5 << 2 ))
69 # This should not be treated as a heredoc (bug#12770).
70 2
71
72 foo='bar<<' # bug#11263
73 echo ${foo%<<aa} # bug#11263
74 echo $((1<<8)) # bug#11263
75 echo $[1<<8] # bug#11263
76
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
83
84 foo () {
85
86 bar () {
87 blilbi
88 }
89
90 case toto
91 in a) hello # KNOWN INDENT BUG
92 ;; b) hi # KNOWN INDENT BUG
93 ;; c) hi # KNOWN INDENT BUG
94 esac
95
96 case $toto in
97 a) echo 1;; b) echo 2;;
98 (c)
99 echo 3;;
100 d)
101 echo 3;;
102 esac
103
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 ;; #(
112 *)
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"
116 ;;
117 esac |
118 grep '.' | # KNOWN INDENT BUG
119 sed 1d
120
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 ;;
126 5)
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
136
137 echo "'" wfgfe
138
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
146 EOF
147
148 cat <<EOF1 <<EOF2 # KNOWN INDENT BUG
149 help1
150 EOF1
151 help2
152 EOF2
153 }
154 bar () {
155 if [ $# -eq 0 ]; then
156 while
157 f # KNOWN INDENT BUG
158 do
159 bla;
160 done
161 echo "Highlighting is screwed up now"
162 if [ 1 = 1 ]; then
163 # adsgsdg
164 echo "screwed up"
165 fi
166
167 $@ $? $#
168
169 for f in *
170 do
171 sdfg
172 done
173
174 if swrgfef
175 then blas
176 else sdf
177 fi
178
179 fi
180 }