]> code.delx.au - gnu-emacs/blob - test/manual/indent/shell.sh
Merge from origin/emacs-25
[gnu-emacs] / test / manual / 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 toto=$(grep hello foo |
7 wc)
8
9 # adsgsdg
10
11 if foo; then
12 if bar; then
13 toto
14 fi
15 fi # bug#15613
16
17 case $X in
18 foo)
19 do_something
20 ;;
21 arg=*) # bug#12953
22 do_something_else_based_on_arg
23 ;;
24 *)
25 default
26 ;;
27 esac
28
29 { # bug#17621
30 foo1 &&
31 foo2 &&
32 bar
33
34 foo1 && \
35 foo2 && \
36 bar
37 }
38
39 for foo in bar; do # bug#17721
40 [ -e $foo ] && {
41 echo t
42 } && {
43 echo r
44 }
45 done
46
47 for foo in bar; do # bug#17896
48 [ -e $foo ] && [ -e $bar ] && {
49 echo just fine thanks
50 }
51 done
52
53 filter_3 () # bug#17842
54 {
55 tr -d '"`' | tr ' ' ' ' | \
56 awk -F\; -f filter.awk | \
57 grep -v "^," | sort -t, -k2,2
58 }
59
60 foo | bar | {
61 toto
62 }
63
64 grep -e "^$userregexp:" /etc/passwd | cut -d : -f 1 | while read user ; do
65 print -u2 "user=$user" # bug#18031
66 sudo -U $user -ll | while read line ; do
67 :
68 done
69 done
70
71 echo -n $(( 5 << 2 ))
72 # This should not be treated as a heredoc (bug#12770).
73 2
74
75 foo='bar<<' # bug#11263
76 echo ${foo%<<aa} # bug#11263
77 echo $((1<<8)) # bug#11263
78 echo $[1<<8] # bug#11263
79
80 declare -a VERSION
81 for i in $(ls "$PREFIX/sbin") ; do
82 echo -e $N')' $i
83 VERSION[${#VERSION[*]}]=$i # bug#11946.
84 N=$(($N + 1))
85 done
86
87 foo () {
88
89 bar () {
90 blilbi
91 }
92
93 case toto
94 in a) hello # KNOWN INDENT BUG
95 ;; b) hi # KNOWN INDENT BUG
96 ;; c) hi # KNOWN INDENT BUG
97 esac
98
99 case $toto in
100 a) echo 1;; b) echo 2;;
101 (c)
102 echo 3;;
103 d)
104 echo 3;;
105 esac
106
107 case $as_nl`(ac_space=' '; set) 2>&1` in #(
108 *${as_nl}ac_space=\ *)
109 # `set' does not quote correctly, so add quotes: double-quote
110 # substitution turns \\\\ into \\, and sed turns \\ into \.
111 sed -n \
112 "s/'/'\\\\''/g;
113 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=/\\1=''/p"
114 ;; #(
115 *)
116 # `set' quotes correctly as required by POSIX, so do not add
117 # quotes.
118 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
119 ;;
120 esac |
121 grep '.' | # KNOWN INDENT BUG
122 sed 1d
123
124 case toto in
125 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
126 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* \
127 | --exec=* | --exe=* | --ex=*)
128 exec_prefix=$ac_optarg ;;
129 5)
130 hello ;;
131 3) hello $(adfad)
132 echo esac ;; # KNOWN INDENT BUG
133 5) hello ;;
134 4) hello ;&
135 4) hello ;;&
136 5) hello ;;
137 5) hello ;;
138 esac
139
140 echo "'" wfgfe
141
142 #!/bin/bash
143 cat << EOF \
144 | cat sadfsafd \
145 sadfsafd "KNOWN INDENT BUG" \
146 | tee -a bug.txt
147 asdfsaf
148 This is a test case for a bug in bash shell mode text highlighting
149 EOF
150
151 cat <<EOF1 <<EOF2 # KNOWN INDENT BUG
152 help1
153 EOF1
154 help2
155 EOF2
156 }
157 bar () {
158 if [ $# -eq 0 ]; then
159 while
160 f # KNOWN INDENT BUG
161 do
162 bla;
163 done
164 echo "Highlighting is screwed up now"
165 if [ 1 = 1 ]; then
166 # adsgsdg
167 echo "screwed up"
168 fi
169
170 $@ $? $#
171
172 for f in *
173 do
174 sdfg
175 done
176
177 if swrgfef
178 then blas
179 else sdf
180 fi
181
182 fi
183 }