Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8209011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:34:27+00:00 2026-06-07T09:34:27+00:00

My first post be gentle. I have the script below which was taken out

  • 0

My first post be gentle.

I have the script below which was taken out of a RedHat 5.3 box to backup an Oracle database. The script was working fine on the Redhat 5.3 box. I then used it as a reference to backup an oracle db on a centos 6.2 box and modified it as required.

#!/bin/bash
ORACLE_HOME="/u01/app/oracle/product/11.2.0/db_1"
NLS_LANG=AMERICAN_AMERICA.AR8ISO8859P6

BKDATE=`date "+%Y-%m-%d_%H-%M-%S"`
C1="system/password@dbname DIRECTORY=RMBACKUP SCHEMAS=USER1,USER2,USER3 DUMPFILE=dbname_"
C2="_full_pump.dmp LOGFILE=dbname_"
C3="_full_pump.log"
BKCMD=$C1$BKDATE$C2$BKDATE$C3
echo $C1
echo $C2
echo $C3
echo $BKDATE
echo $BKCMD
#run the exp backup
$ORACLE_HOME/bin/expdp $BKCMD

The weird bahavior is that when I execute the script the new line causes a command not found error and the concatenation gets merged as seen below.

system/password@dbname DIRECTORY=RMBACKUP SCHEMAS=USER1,USER2,USER3 DUMPFILE=dbname_
_full_pump.dmp LOGFILE=dbname_
_full_pump.log
2012-07-10_09-39-06
system/password@dbname DIRECTORY=RMBACKUP SCHEMAS=USER1,USER2,USER3 DUMPFI_full_pump.log39-06ILE=dbname_
/bin/expdp: No such file or directoryacle/product/11.2.0/db_1

The date merging with the other text is not a typo, that is the echo output.

I added set -x at the beginning and here is the output

+ ORACLE_HOME=$'/u01/app/oracle/product/11.2.0/db_1\r'
+ NLS_LANG=$'AMERICAN_AMERICA.AR8ISO8859P6\r'
++ date +%Y-%m-%d_%H-%M-%S
+ BKDATE=$'2012-07-10_10-27-45\r'
+ C1='system/password@dbname DIRECTORY=RMBACKUP SCHEMAS=USER1,USER2,USER3 DUMPFI'E=dbname_
' C2='_full_pump.dmp LOGFILE=dbname_
+ C3=_full_pump.log
+ BKCMD='system/password@dbname DIRECTORY=RMBACKUP SCHEMAS=USER1,USER2,USER3 DUM_full_pump.log'7-45ILE=dbname_
+ echo system/password@dbname DIRECTORY=RMBACKUP SCHEMAS=USER1,USER2,USER3 $'DUMPFILE=dbname_\r'
system/password@dbname DIRECTORY=RMBACKUP SCHEMAS=USER1,USER2,USER3 DUMPFILE=dbname_
+ echo _full_pump.dmp $'LOGFILE=dbname_\r'
_full_pump.dmp LOGFILE=dbname_
+ echo $'_full_pump.log\r'
_full_pump.log
+ echo $'2012-07-10_10-27-45\r\r'
2012-07-10_10-27-45
+ echo system/password@dbname DIRECTORY=RMBACKUP SCHEMAS=USER1,USER2,USER3 $'DUMPFILE=dbname_\r2012-07-10_10-27-45\r_full_pump.dmp' $'LOGFILE=dbname_\r2012-07-10_10-27-45\r_full_pump.log\r'
system/password@dbname DIRECTORY=RMBACKUP SCHEMAS=USER1,USER2,USER3 DUMPFILE=dbn_full_pump.log27-45ILE=dbname_
+ $'/u01/app/oracle/product/11.2.0/db_1\r/bin/expdp' system/password@dbname DIRECTORY=RMBACKUP SCHEMAS=USER1,USER2,USER3 $'DUMPFILE=dbname_\r2012-07-10_10-27-45\r_full_pump.dmp' $'LOGFILE=dbname_\r2012-07-10_10-27-45\r_full_pump.log\r'
/bin/expdp: No such file or directoryacle/product/11.2.0/db_1

Waiting for responses…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T09:34:28+00:00Added an answer on June 7, 2026 at 9:34 am

    As you can see, there are '\r' characters in the texts. Probably you edited the file with an editor that adds \r at the end of lines automatically. You must edit the file once again and remove these characters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first post on StackOverflow, so please be gentle... I have some
My first post here :) I have a summer job doing a bit of
This is my first post and I my first experience with jquery. I have
Its my first post and I'm really rusty on MSSQL so be gentle :-)
This is my first post, so please be gentle. I've been playing around with
This is my first post on this forum (so please be gentle ) I'm
First post, but long time browser :) So here's my problem: Basically I have
First post, please be kind. NOTE: I have reviewed entry #20856 (how to implement
First post. I've searched high and low for similar questions and have come up
first post, so play nice! I have a fairly basic question about Python dictionaries.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.