Move the file from one path to another using .sh file in EBS Oracle apps.

Hi All,

I just want to move the file from one path to another using .sh file in EBS oracle apps.

I have written in .prog but i need in .sh (file.sh)

XXC_SAMPLE_FILE.prog

#!/bin/bash
  # XXC_SAMPLE_FILE.prog
  DATE_TIME=`date | awk {' print $1"_"$2"_"$3"_"$4 '}`
  echo "parse_parms"
  REQID=$5
  echo $5
  echo "Request Id:" $REQID
  OUTPUT_FILE=$APPLCSF/$APPLOUT/o$REQID.out
  ATTACH_FILE="/XXC_OUTPUT"
  cp $OUTPUT_FILE $ATTACH_FILE

  echo " "
  echo "-----------------------------------------------------------------------"
  echo " "
  now1=$(date +"%T")
  echo "Installation Start time : $now1" 
  # ************************************
  #  End of Script
 # ********************************

Can you please help me on this?

Thank you,

I think it works like it is.
Suggestions for improvement:

DATE_TIME=`date | awk {' print $1"_"$2"_"$3"_"$4 '}`

works, but the { } should be inside the ' ', to explicitly escape the { } special meaning in the shell.

DATE_TIME=`date | awk '{ print $1"_"$2"_"$3"_"$4 }'`

Put quotes around $variables in command arguments, to prevent the shell from doing further substitutions on them.

echo "$5"
cp "$OUTPUT_FILE" "$ATTACH_FILE"

echo and cp are commands.

Thank you very much i will try and keep you posting the update

Hi ,

Can you please help me on this?

Thank you

Help you with what?

What did you try?

What happened?

What isn't working the way you want it to work?

What operating system are you using?

You are using the variables APPLCSF and APPLOUT without setting them? What values do they have in your environment when you run your script?

What command line is used to invoke your script?

Are you getting any diagnostics when you invoke your script? If so, what do they say (exactly in CODE tags, please)?

Assuming that you're running in the C or POSIX locale or in an American locale, why are you using:

  DATE_TIME=`date | awk {' print $1"_"$2"_"$3"_"$4 '}`

instead of:

  DATE_TIME=$(date '+%a_%b_%d_%T')

If you're not running in one of the locales mentioned above, what format are you hoping will be used when assigning a value to DATE_TIME ?

PS. Note that it is unusual to write a script that requires five operands but never looks at the first four of them. Why do you do that?