aboutsummaryrefslogtreecommitdiff
path: root/test/bin
blob: 75c399de7ab5f076f7d25f036107b46e69fce862 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
for bin in bin/* ; do
    hb=$(sed 1q "$bin") || exit
    case $hb in
        *bash)
            bash -n "$bin" || exit 1
            ;;
        *sh)
            sh -n "$bin" || exit 1
            ;;
        *'sed -f')
            sed -f "$bin" /dev/null >/dev/null || exit 1
            ;;
        *'awk -f')
            # Not sure how to test these yet
            ;;
        *)
            printf 2>&1 'Unknown hashbang for %s\n' "$bin"
            exit 1
            ;;
    esac
done
printf 'All shell scripts in bin parsed successfully.\n'