Fix bug with make-directory on MS-Windows root
[emacs.git] / test / manual / indent / shell.sh
blobdc184ea0d77cbeeacd6f24171b4355b78f2ba9f7
1 #!/bin/sh
2 # -*- eval: (bug-reference-mode 1) -*-
4 setlock -n /tmp/getmail.lock && echo getmail isn\'t running
6 toto=$(grep hello foo |
7 wc)
9 # adsgsdg
11 if foo; then
12 if bar; then
13 toto
15 fi # bug#15613
17 case $X in
18 foo)
19 do_something
21 arg=*) # bug#12953
22 do_something_else_based_on_arg
25 default
27 esac
29 { # bug#17621
30 foo1 &&
31 foo2 &&
32 bar
34 foo1 && \
35 foo2 && \
36 bar
39 for foo in bar; do # bug#17721
40 [ -e $foo ] && {
41 echo t
42 } && {
43 echo r
45 done
47 for foo in bar; do # bug#17896
48 [ -e $foo ] && [ -e $bar ] && {
49 echo just fine thanks
51 done
53 filter_3 () # bug#17842
55 tr -d '"`' | tr ' ' ' ' | \
56 awk -F\; -f filter.awk | \
57 grep -v "^," | sort -t, -k2,2
60 foo | bar | {
61 toto
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
68 done
69 done
71 echo -n $(( 5 << 2 ))
72 # This should not be treated as a heredoc (bug#12770).
75 foo='bar<<' # bug#11263
76 echo ${foo%<<aa} # bug#11263
77 echo $((1<<8)) # bug#11263
78 echo $[1<<8] # bug#11263
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
87 foo () {
89 bar () {
90 blilbi
93 case toto
94 in a) hello # KNOWN INDENT BUG
95 ;; b) hi # KNOWN INDENT BUG
96 ;; c) hi # KNOWN INDENT BUG
97 esac
99 case $toto in
100 a) echo 1;; b) echo 2;;
102 echo 3;;
104 echo 3;;
105 esac
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 ;; #(
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"
120 esac |
121 grep '.' | # KNOWN INDENT BUG
122 sed 1d
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 ;;
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
140 echo "'" wfgfe
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
151 cat <<EOF1 <<EOF2 # KNOWN INDENT BUG
152 help1
153 EOF1
154 help2
155 EOF2
157 bar () {
158 if [ $# -eq 0 ]; then
159 while
160 f # KNOWN INDENT BUG
162 bla;
163 done
164 echo "Highlighting is screwed up now"
165 if [ 1 = 1 ]; then
166 # adsgsdg
167 echo "screwed up"
170 $@ $? $#
172 for f in *
174 sdfg
175 done
177 if swrgfef
178 then blas
179 else sdf