reduce 313 B

12345678910111213141516
  1. O=$1
  2. shift
  3. objtype=$1
  4. shift
  5. ls -p ../$objtype/*.[cs] >[2]/dev/null | sed 's/..$//;s/^/^/' > /tmp/reduce.$pid
  6. #
  7. # if empty directory, just return the input files
  8. #
  9. if (! ~ $status '|') {
  10. echo $*
  11. rm /tmp/reduce.$pid
  12. exit 0
  13. }
  14. echo $* | tr ' ' \012 | grep -v -f /tmp/reduce.$pid | tr \012 ' '
  15. rm /tmp/reduce.$pid