2 Replies Latest reply: Apr 18, 2014 8:09 AM by Catch~22 RSS

    Moving a script from hp unix to red hat linux

    1005995

      Hi, I have an issue where i got stuck any help is greatly appreciated. I have a script which runs fine in unix but in red hat linux when i run the same script it says

       

      #Verify temp directory

      if [[ -d $8 ]]; then

        REMOTE_DIR_LIST=`mktemp -d /tmp`

        LOCAL_DIR_LIST=`mktemp -d /tmp`

        TEMP_FILE=`mktemp -d /tmp`

      else

        echo "Invalid temp dir [$8]"

        return 1

      fi

       

      log

       

      mktemp: cannot make temp dir /tmp: File exists

      mktemp: cannot make temp dir /tmp: File exists

      mktemp: cannot make temp dir /tmp: File exists

      ftpmput.sh: line 78: $TEMP_FILE: ambiguous redirect

      ftpmput.sh: line 80: $TEMP_FILE: ambiguous redirect

      ftpmput.sh: line 82: $TEMP_FILE: ambiguous redirect

      ftpmput.sh: line 84: $TEMP_FILE: ambiguous redirect

      ftpmput.sh: line 86: $TEMP_FILE: ambiguous redirect

      ftpmput.sh: line 88: $TEMP_FILE: ambiguous redirect

      ftpmput.sh: line 90: $TEMP_FILE: ambiguous redirect

       

       

      ftpmput.sh: line 95: $TEMP_FILE: ambiguous redirect

      ftp command failed!\n

      rm: missing operand

      Try `rm --help' for more information.

      ftpmput.sh: line 106: $LOCAL_DIR_LIST: ambiguous redirect

       

       

       

      Please can anyone help me with this Thanks in advance

        • 1. Re: Moving a script from hp unix to red hat linux
          Catch~22

          HPUX is a bit unique and the mktemp utility is different. You can probably work around the issue by replacing the following:

           

          Instead of `mktemp -d /tmp` for TEMP_FILE use `mktemp /tmp/tmp.XXXXXXXXX`

           

          For REMOTE_DIR_LIST and LOCAL_DIR_LIST simply use `mktemp` to have the utility create a directory in /tmp. Though I don't really understand the purpose of these.

          • 2. Re: Moving a script from hp unix to red hat linux
            Catch~22

            Also note that Linux uses bash and not ksh as the default shell. If your scripts rely on ksh'88 you might run into compatibility issues because this version is not public domain. You have ksh'93 on Linux, but pdksh, which provides more backward compatibility with ksh'88 is no longer available since RHEL and OL 6.