sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

mkproto (499B)


      1 #!/bin/sh
      2 
      3 usage()
      4 {
      5 	echo mkproto: prefix manprefix proto>&2
      6 	exit 1
      7 }
      8 
      9 prefix=${1?$(usage)}
     10 manprefix=${2?$(usage)}
     11 proto=${3?$(usage)}
     12 
     13 trap "rm -f scripts/proto" EXIT INT QUIT TERM
     14 
     15 (set -e
     16 echo d $prefix/bin $prefix/bin 755
     17 find . ! -name . -prune -type f \( -perm -u+x -o -perm -g+x -o -perm o+x \) |
     18 sed "s@.*@c & $prefix/bin/& 755@"
     19 
     20 echo d $manprefix/man1 $manprefix/man1 755
     21 find . ! -name . -prune -name '*.1' |
     22 sed "s@.*@c & $manprefix/man1/& 644@") > $proto
     23 
     24 trap "" EXIT INT QUIT TERM