You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dynamicProperties.sh 454B

1234567891011121314151617181920
  1. #!/bin/bash
  2. SOURCE="${1}"
  3. TARGET="${2}"
  4. if [ "" = "${TARGET}" -o ! -e "${SOURCE}" ]; then
  5. echo "Usage: ${0} dynamic.properties private.properties";
  6. else
  7. # Make sure target exists.
  8. if [ ! -e "${TARGET}" ]; then
  9. mkdir -p `dirname "${TARGET}"`
  10. touch "${TARGET}"
  11. fi;
  12. # Remove existing private.properties line
  13. sed '/^private\.classpath[\s]*=.*$/d' -i "${TARGET}"
  14. # Add new one.
  15. cat "${SOURCE}" | grep "^private\.classpath" >> "${TARGET}"
  16. fi;