blob: 7004ffcb56b31deac152b43d0c6443b06c89b7be (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
#! /bin/sh -e
# valid
. /usr/share/lintian/shell || exit 0
. /usr/share/lintian/shell >/dev/null
. /usr/share/lintian/shell 2>/dev/null
. /usr/share/lintian/shell </dev/null
. "$(dirname $0)/shell" ; bar
# invalid
. /usr/share/lintian/shell foo
. "$(dirname $0)/shell" bar
print "Hit enter to continue"
read
H[0]='this is a string'
echo ${H[0]}
echo "Index 0's length is ${#H[0]}"
echo "All of the array is: ${H[@]}"
# This too is a heredoc.
some-program > /etc/config-file <<'EOF'
echo "All of the array is: ${H[@]}"
EOF
# But this isn't.
cat '<<EOF'
echo "All of the array is: ${H[@]}"
EOF
# This is a heredoc
cat <<-EOF
echo "All of the array is ${H[@]}"
EOF
# As is this
cat <<';'
echo "All of the array is ${H[@]}"
;
# and this
cat <<foo
echo "All of the array is ${H[@]}"
foobar
echo $HOSTNAME
foo
# and again
cat <<\bar
echo "All of the array is ${H[@]}"
bar
# yet another
cat <<"x++"
echo "All of the array is ${H[@]}"
x++
# Recognize single quotes even if they start at the beginning of a line.
echo not a bashism \
'/{ptex,tex}/{amstex,plain,generic,}'
# More bashisms.
echo -e 'foo\n'
echo "${!foo}"
cat $(\< file)
select foo in a b ; do echo $foo ; done
cnt=$((cnt + 1))
if false ; then
exec -l /bin/sh
exec -c /bin/sh
exec -a foo /bin/sh
fi
let cnt++
if test -a /etc/default ; then
echo "$RANDOM|stuff"
fi
# Some comment checking
# This should flag $RANDOM
test $# -gt 2 && echo $RANDOM
# But these shouldn't
test 1=1 # echo $RANDOM
(test 1=1)# echo $RANDOM
test 1=1;# echo $RANDOM
backgroundtask &#echo $RA
#DEBHELPER#
|