Problem starting a UNIX shell script from an Oracle parallel program

I am trying to run a HOST script that I created in the KSH shell using the parallel Oracle program.

My test script looks like this:

echo "System Parameters passed by Concurrent Manager"
echo "+--------------------------------------------+"
XXWIN_PROGRAM=$0
XXWIN_LOGIN=$1
XXWIN_USERID=$2
XXWIN_USERNAME=$3
XXWIN_REQUEST_ID=$4
echo "XXWIN_PROGRAM    :"$XXWIN_PROGRAM
echo "XXWIN_LOGIN      :"$XXWIN_LOGIN
echo "XXWIN_USERID     :"$XXWIN_USERID
echo "XXWIN_USERNAME   :"$XXWIN_USERNAME
echo "XXWIN_REQUEST_ID :"$XXWIN_REQUEST_ID

shift 4
echo ""
echo "User Parameters passed by Concurrent Manager"
echo "+------------------------------------------+"
echo "1  :"$1
echo "2  :"$2
echo "3  :"$3
echo "4  :"$4
echo "5  :"$5
echo "6  :"$6
echo "7  :"$7
echo "8  :"$8
echo "9  :"$9
echo ""

# Generic Script Begins
# Declaring Constants, Data File Path, Control File Path etc 

CTL_FILE_NAME=$1     # Control File Name(s)
CTL_FILE_PATH=$2     # Control File Path
DATA_FILE_NAME=$3    # Data File Name(s)
DATA_FILE_PATH=$4    # Data File Path
COMPONENT_NAME=$5    # Interface Component Name
SEQ_VALIDATION=$6    # Sequence Name
SUPPORT_EMAIL= $7    # Support e-mail(s) List

# Printing the User Parameters
echo "1  :"$CTL_FILE_NAME
echo "2  :"$CTL_FILE_PATH
echo "3  :"$DATA_FILE_NAME
echo "4  :"$DATA_FILE_PATH
echo "5  :"$COMPONENT_NAME
echo "6  :"$SEQ_VALIDATION
echo "7  :"$SUPPORT_EMAIL

# Assigning the Archive, IN and Prog Dir Paths
ARCHIVE_DIR="$XXWIN_TOP/bin/TEMP/archive"
XXWIN_IN_DIR="$XXWIN_TOP/bin/TEMP/in"
XXWIN_PROG_DIR="$XXWIN_TOP"

# Printing the directories
echo "Archive Directory :" $ARCHIVE_DIR
echo "IN Directory :" $XXWIN_IN_DIR
echo "Program Directory :" $XXWIN_PROG_DIR

i=10
k=5
j=`expr $i + $k`
echo $j

echo $i 

echo "Out of Concurrent Program"

A shell script name of the program ends with .prog

I run a parallel query with the following parameters: alt text

The program works fine, but I get the following log messages. alt text

alt text

If I use #!/usr/bin/ksh, the program fails, so I run the host file without it. From the log it is clear that when any space is encountered in the script, it throws an error message "Command not found." Also, as you can see, I am making a simple addition, even this is also not recognized.

Any help in this regard is greatly appreciated.

Thank:)

+3
3

Windows script? + Unix- . script. Unix- dos2unix .

, script , , .

+1

CAT -vt <filename>, , , ^ M ^ I. - ( ASCII, ).

VI script. , script, .

, . notepad ++ .

0

VI, CAT , Linux/Unix . , , Notepad ++. , . ( FTP, ), -M. ASCII . FTP. , .

0

Source: https://habr.com/ru/post/1776489/


All Articles