#!/bin/sh

if [ "$1" != "upgrade" ]; then
       update-alternatives --remove dummy /usr/bin/dummy-alternative
fi

if ([ "$1" = "upgrade" ] || [ "$1" = "remove" ]) && [ -L /usr/doc/maintainer-scripts ]; the
n
        rm -f /usr/doc/maintainer-scripts
fi

cat <<EOF
This is all really bad bash specific code!!!
read
source /bar/baz/bat foo
EOF

# ok, back to checking
if [ "$2" == "purge" ]; then
	rm -r /bar/baz
fi

function foo( ) {
   # but not here: local
   local bar
   echo "foo" &>/dev/null
}

source $FOO

trap "echo hi" EXIT HUP 3

if [[ "$2" = "purge" ]]; then
    kill -HUP $$
fi

#this is ok though
if test -n $(echo foo | perl -pe 's/[[:space:]]//go'); then
    echo 1
fi

update-rc.d foo remove

# More false positives for bashism checks.  None of these are errors.
echo "$line" | grep -q '{fonts/map,}/{\$progname,pdftex,dvips,}//'
echo '$[1+2]'
printf "foo |& bar"
perl -e "print q( kill -HUP $? )"

# Still catch disallowed expansions in double-quotes, though.
echo "${line:3:1}"

# The wrong way to run an init script (no invoke-rc.d).
/etc/init.d/package stop
