This discussion is archived
3 Replies Latest reply: Oct 28, 2012 6:46 PM by Hussein Sawwan-Oracle RSS

Help in Shell Scripts

946257 Newbie
Currently Being Moderated
Hi,

I am new to shell scripting, i am getting an error while i am running a concurrent program, the executable method is host. Below are the details.
I am trying to copy the file from one directory to another one using the shell script.
I created the .prog file in ap/12.0.0/bin directory
and also i have created the soft linkusing the ln -s command
do i need to create the parameters for $1-$4 in the concurrent program? or will it be automatically using the environment of oracle apps
here is the .prog file

DataFileName=$5
SourceDirectory=$6
TargetDirectory=$7
echo “————————————————–”
echo “Parameters received from concurrent program ..”
echo ” Time : “`date`
echo “————————————————–”
echo “Arguments : ”
echo ” Data File Name : “${DataFileName}
echo ” SourceDirectory : “${SourceDirectory}
echo ” TargetDirectory : “${TargetDirectory}
echo “————————————————–”
echo ” Copying the file from source directory to target directory…”
cp ${SourceDirectory}/${DataFileName} ${TargetDirectory}
if [ $? -ne 0 ]
then
echo “Entered Exception”
exit 1
else
exit 0
fi
echo “****************************************************************”
  • 1. Re: Help in Shell Scripts
    Hussein Sawwan-Oracle Employee ACE
    Currently Being Moderated
    Please post the details of the application release, database version and OS.
    I am new to shell scripting, i am getting an error while i am running a concurrent program, the executable method is host. Below are the details.
    What is the error? Please post the contents of the concurrent request log file here.
    I am trying to copy the file from one directory to another one using the shell script.
    I created the .prog file in ap/12.0.0/bin directory
    and also i have created the soft linkusing the ln -s command
    do i need to create the parameters for $1-$4 in the concurrent program? or will it be automatically using the environment of oracle apps
    here is the .prog file

    DataFileName=$5
    SourceDirectory=$6
    TargetDirectory=$7
    echo “————————————————–”
    echo “Parameters received from concurrent program ..”
    echo ” Time : “`date`
    echo “————————————————–”
    echo “Arguments : ”
    echo ” Data File Name : “${DataFileName}
    echo ” SourceDirectory : “${SourceDirectory}
    echo ” TargetDirectory : “${TargetDirectory}
    echo “————————————————–”
    echo ” Copying the file from source directory to target directory…”
    cp ${SourceDirectory}/${DataFileName} ${TargetDirectory}
    if [ $? -ne 0 ]
    then
    echo “Entered Exception”
    exit 1
    else
    exit 0
    fi
    echo “****************************************************************”
    Please see these docs/links.

    How to Register a Host Concurrent Program in Applications [ID 156636.1]
    How To Setup A Custom Concurrent Host Program [ID 147455.1]

    https://forums.oracle.com/forums/search.jspa?threadID=&q=host+AND+concurrent&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001

    Thanks,
    Hussein
  • 2. Re: Help in Shell Scripts
    946257 Newbie
    Currently Being Moderated
    Thanks for the reply.
    actually i have a question which i am unable to find in the internet is
    Do we need to create concurrent program parameters for $1,$2,$3,$4
    and give the values while runtime or is it just the program would take from the oracle environment automatically
  • 3. Re: Help in Shell Scripts
    Hussein Sawwan-Oracle Employee ACE
    Currently Being Moderated
    943254 wrote:
    Thanks for the reply.
    actually i have a question which i am unable to find in the internet is
    Do we need to create concurrent program parameters for $1,$2,$3,$4
    and give the values while runtime or is it just the program would take from the oracle environment automatically
    You do not need to create any parameters.

    Thanks,
    Hussein

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points