scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

install (409B)


      1 #!/bin/sh
      2 
      3 set -e
      4 
      5 for i
      6 do
      7 	case "$i" in
      8 	-p)
      9 		proto=$2
     10 		shift 2
     11 		;;
     12 	-*)
     13 		echo usage: install [-p proto] prefix >&2
     14 		exit 1
     15 		;;
     16 	esac
     17 done
     18 
     19 prefix=${1?'prefix missed'}
     20 
     21 while read type perm name
     22 do
     23 	case $type in
     24 	d)
     25 		mkdir -p $prefix/$name
     26 		;;
     27 	f)
     28 		cp $name $prefix/$name
     29 		;;
     30 	*)
     31 		echo install: wrong entry type >&2
     32 		exit 1
     33 		;;
     34 	esac
     35 
     36 	chmod $perm $prefix/$name
     37 done < ${proto:-scripts/proto}