aboutsummaryrefslogblamecommitdiff
path: root/test/bin
blob: 4b68d6b8286db087eaef33c57afa43cf94b2a601 (plain) (tree)
1
2
3
4
5
6
7
8
9

                     
                             


                               
                                  

              
                                

                  
                                                      








                                                          

                                                        
#!/bin/sh
for bin in bin/* ; do
    [ -f "$bin" ] || continue
    hb=$(sed 1q "$bin") || exit
    case $hb in
        *bash)
            bash -n "$bin" || exit
            ;;
        *sh)
            sh -n "$bin" || exit
            ;;
        *'sed -f')
            sed -f "$bin" /dev/null >/dev/null || exit
            ;;
        *'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'