mkrootall 386 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/rc
  2. rfork e
  3. n=`{echo $#*^'%3' | hoc}
  4. if(! ~ $n 0){
  5. echo 'usage: mkrootall [name cname file]...' >[1=2]
  6. exit usage
  7. }
  8. tmp=mkroot.$pid.out
  9. fn sigexit {
  10. rm -f $tmp
  11. }
  12. allcname=()
  13. while(! ~ $#* 0){
  14. name=$1
  15. cname=$2
  16. file=$3
  17. shift
  18. shift
  19. shift
  20. allcname=($allcname $cname)
  21. cp $file $tmp
  22. t=`{file $tmp}
  23. if(~ $"t *executable*)
  24. strip $tmp
  25. aux/data2s $cname < $tmp
  26. }
  27. exit 0