removecomments.sh 299 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. # Remove comments from .sources files since this usage of IFS is unsuable inside make
  3. # (trouble with newlines)
  4. source_files="$@"
  5. OIFS=$IFS
  6. for f in $source_files ; do
  7. IFS='
  8. '
  9. for f in `cat $f` ; do
  10. case $f in
  11. \#*) ;;
  12. *) echo $f ;;
  13. esac
  14. done
  15. OIFS=$IFS
  16. done
  17. IFS=$OIFS