#!/bin/sh -eux # XXX: We use /bin/sh instead of /bin/bash since some old versions of bash # exhibit an issue where they seem to receive the same signal twice. # With /bin/sh, this does not seem to happen. # Print received signals into a file, one per line file="$1" . ./lib/testlib.sh for i in $(catchable_signals); do trap "echo $i > \"$file\"" "$i" done echo 'ready' > "$file" echo 'loop forever...' set +x while :; do true; done