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

                     
                             


                               
                                  

              
                                

                  
                                                      








                                                          

                                                        
#!/bin/sh
for bin in bin/* ; do
    [ -e "$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'