* lisp/progmodes/sh-script.el (sh--inside-noncommand-expression):
[bpt/emacs.git] / 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 echo -n $(( 5 << 2 ))
9 # This should not be treated as a heredoc (bug#12770).
10 2
11
12 foo='bar<<' # bug#11263
13 echo ${foo%<<aa} # bug#11263
14 echo $((1<<8)) # bug#11263
15 echo $[1<<8] # bug#11263
16
17 declare -a VERSION
18 for i in $(ls "$PREFIX/sbin") ; do
19 echo -e $N')' $i
20 VERSION[${#VERSION[*]}]=$i #bug#11946.
21 N=$(($N + 1))
22 done
23
24 foo () {
25
26 bar () {
27 blilbi
28 }
29
30 case toto
31 in a) hello # KNOWN INDENT BUG
32 ;; b) hi # KNOWN INDENT BUG
33 ;; c) hi # KNOWN INDENT BUG
34 esac
35
36 case $toto in
37 a) echo 1;; b) echo 2;;
38 (c)
39 echo 3;;
40 d)
41 echo 3;;
42 esac
43
44 case $as_nl`(ac_space=' '; set) 2>&1` in #(
45 *${as_nl}ac_space=\ *)
46 # `set' does not quote correctly, so add quotes: double-quote
47 # substitution turns \\\\ into \\, and sed turns \\ into \.
48 sed -n \
49 "s/'/'\\\\''/g;
50 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=/\\1=''/p"
51 ;; #(
52 *)
53 # `set' quotes correctly as required by POSIX, so do not add
54 # quotes.
55 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
56 ;;
57 esac |
58 grep '.' | # KNOWN INDENT BUG
59 sed 1d
60
61 case toto in
62 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
63 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* \
64 | --exec=* | --exe=* | --ex=*)
65 exec_prefix=$ac_optarg ;;
66 5)
67 hello ;;
68 3) hello $(adfad)
69 echo esac ;; # KNOWN INDENT BUG
70 5) hello ;;
71 4) hello ;&
72 4) hello ;;&
73 5) hello ;;
74 5) hello ;;
75 esac
76
77 echo "'" wfgfe
78
79 #!/bin/bash
80 cat << EOF \
81 | cat sadfsafd \
82 sadfsafd "KNOWN INDENT BUG" \
83 | tee -a bug.txt
84 asdfsaf
85 This is a test case for a bug in bash shell mode text highlighting
86 EOF
87
88 cat <<EOF1 <<EOF2 # KNOWN INDENT BUG
89 help1
90 EOF1
91 help2
92 EOF2
93 }
94 bar () {
95 if [ $# == 0 ]; then
96 while
97 f # KNOWN INDENT BUG
98 do
99 bla;
100 done
101 echo "Highlighting is screwed up now"
102 if [ 1 = 1 ]; then
103 # adsgsdg
104 echo "screwed up"
105 fi
106
107 $@ $? $#
108
109 for f in *
110 do
111 sdfg
112 done
113
114 if swrgfef
115 then blas
116 else sdf
117 fi
118
119 fi
120 }