-Cameron Index: merlinx =================================================================== RCS file: /home/cvspublic/avalon/merlin/cli/src/bin/merlinx,v retrieving revision 1.2 diff -u -r1.2 merlinx --- merlinx 6 May 2004 18:56:03 -0000 1.2 +++ merlinx 7 May 2004 13:03:09 -0000 @@ -8,14 +8,19 @@ # respectively. #
-#usage VARIABLE=`find_maven_repo "property_file" "property_name" "default_value"`
-function find_property()
+#usage VARIABLE=`find_property "property_file" "property_name" "default_value"`
+find_property()
{
- VAL=${3}
- if [ -f ${1} ] ; then
- VAL=`cat ${1} | grep ^${2} | cut -d= -f2`
+ VAL=
+ if [ -f "${1}" ] ; then
+ VAL=`cat "${1}" | grep "^${2}" | cut -d= -f2`
+ fi
+
+ if [ "${VAL}" = "" ] ; then
+ echo "${3}"
+ else
+ echo "${VAL}"
fi
- echo ${VAL}
}
#
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
