mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

lutoff
23.52.2009 5a726240a2e3fc25d7d324ff483567ec4b1b06ee
Fix for issue #3626 (Occurrences of grep, cat,... commands should be replaced with sh built-in commands)
Replace occurrences of 'cat' and 'grep' by shell builtin command.

3 files modified
26 ■■■■■ changed files
opends/resource/bin/_script-util.sh 19 ●●●●● patch | view | raw | blame | history
opends/resource/bin/stop-ds 3 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/util/Utils.java 4 ●●●● patch | view | raw | blame | history
opends/resource/bin/_script-util.sh
@@ -205,7 +205,7 @@
          exit 0
    fi
      fi
      INSTANCE_ROOT=`cat /etc/opends/instance.loc`
      read INSTANCE_ROOT <  /etc/opends/instance.loc
    else
      if [ "${SCRIPT_NAME}" != "configure" ]
      then
@@ -220,12 +220,17 @@
  else
    if [ -f ${INSTALL_ROOT}/instance.loc ]
    then
      if cat ${INSTALL_ROOT}/instance.loc | grep '^/' > /dev/null
      then
         INSTANCE_ROOT=`cat ${INSTALL_ROOT}/instance.loc`
      else
         INSTANCE_ROOT=${INSTALL_ROOT}/`cat ${INSTALL_ROOT}/instance.loc`
      fi
      read location < ${INSTALL_ROOT}/instance.loc
      case `echo ${location}` in
           /*)
              INSTANCE_ROOT=${location}
              break
              ;;
           *)
              INSTANCE_ROOT=${INSTALL_ROOT}/${location}
              break
              ;;
      esac
    else
         INSTANCE_ROOT=${INSTALL_ROOT}
    fi
opends/resource/bin/stop-ds
@@ -159,7 +159,8 @@
then
  if test -f "${INSTANCE_ROOT}/logs/server.pid"
  then
    kill `cat "${INSTANCE_ROOT}/logs/server.pid"`
    read PID < "${INSTANCE_ROOT}/logs/server.pid"
    kill ${PID}
    EXIT_CODE=${?}
    if test ${EXIT_CODE} -eq 0
    then
opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 */
package org.opends.quicksetup.util;
@@ -1214,7 +1214,7 @@
    try
    {
      line = reader.readLine();
      File instanceLoc =  new File (line);
      File instanceLoc =  new File (line.trim());
      if (instanceLoc.isAbsolute())
      {
        return instanceLoc.getAbsolutePath();