cp & sed error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting cp & sed error
# 15  
Old 02-07-2006
I get this error with the mv command....

./createdb.sh[139]: /u01/app/oracle/admin/db2/pfile/: cannot create
mv: cannot rename /u01/app/oracle/admin/db2/pfile/ to /u01/app/oracle/admin/db2/pfile/init.ora.162006131752: Invalid argument
# 16  
Old 02-07-2006
Post all the relevant commands from your script that threw up the error result.
# 17  
Old 02-07-2006
Code:
for i `ls -1 $ORACLE_BASE/admin/${dest}/pfile/`
do
  echo src=${src}
  echo dest=${dest}
  echo "replacing ${src} to ${dest} for $i"
  echo "s#${src}#${dest}#g"
  sed -e "s#${src}#${dest}#g" "$ORACLE_BASE/admin/${dest}/pfile/$i" >> "$ORACLE_BASE/admin/${dest}/pfile/$i_backup"
  mv "$ORACLE_BASE/admin/${dest}/pfile/$i_backup" "$ORACLE_BASE/admin/${dest}/pfile/$i"
  done

# 18  
Old 02-07-2006
See if the file exists or not.

Code:
for i `ls -1 $ORACLE_BASE/admin/${dest}/pfile/`
do
  echo src=${src}
  echo dest=${dest}
  echo "replacing ${src} to ${dest} for $i"
  echo "s#${src}#${dest}#g"
  sed -e "s#${src}#${dest}#g" "$ORACLE_BASE/admin/${dest}/pfile/$i" >> "$ORACLE_BASE/admin/${dest}/pfile/$i_backup"
  echo "$ORACLE_BASE/admin/${dest}/pfile/$i_backup $ORACLE_BASE/admin/${dest}/pfile/$i"
#  mv "$ORACLE_BASE/admin/${dest}/pfile/$i_backup" "$ORACLE_BASE/admin/${dest}/pfile/$i"
  done

# 19  
Old 02-07-2006
this is the output i get....looks like the i_backup file doesnt exist??

./createdb.sh[139]: /u01/app/oracle/admin/db2/pfile/: cannot create
./createdb.sh[140]: /u01/app/oracle/admin/db2/pfile/: cannot execute
/u01/app/oracle/admin/db2/pfile/ /u01/app/oracle/admin/db2/pfile/init.ora.162006131752
# 20  
Old 02-07-2006
What are you trying to do ? Migration ?

See if you have write permissions on the destination directory.

sed -e "s#${src}#${dest}#g" "$ORACLE_BASE/admin/${dest}/pfile/$i" >> "$ORACLE_BASE/admin/${dest}/pfile/$i_backup" will fail if you have no write permissions and hence no $i_backup will be present. So mv statement will fail.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Echo "abc" | sed - r 's/a/&_&/

I want to know the working of & here step by step using sed command. (1 Reply)
Discussion started by: Preeti07
1 Replies

2. Shell Programming and Scripting

Need Script to ZIP/SAVE & then DELETE Log file & send a mail conformation for any error

ENVIROMENT Linux: RHEL 6.4 Log Path: /usr/iplanet/servers/https-company/logs Log Format: user.log.03-15-2015 I have log4j log rotation enabled rotating files on a daily basis. The rotated logs are NOT compressed & are taking up too much space. I need a script that will run daily that... (1 Reply)
Discussion started by: admin_job_admin
1 Replies

3. Shell Programming and Scripting

if statement with '&&' gives error

Hi, I'm using the && operator in if statement: if ; then exp $UID/$PWD@$ORACLE_SID FILE=./DUMP/$TODAY$CONCAT_STR$USERNAME.dmp STATISTICS=NONE LOG=./LOG/$TODAY$CONCAT_STR$USERNAME.log elif ; then expdp $UID/$PWD@$ORACLE_SID DIRECTORY=./DUMP/ DUMPFILE=$TODAY$CONCAT_STR$USERNAME.dmp... (8 Replies)
Discussion started by: priya001
8 Replies

4. Shell Programming and Scripting

Help with sed ( & )

I am searching for a specific pattern and replacing with ( ) for matched pattern .I am not getting the expected result ..... Here is the file cat test cool change Frinto Francis Frinto cool change Attitude /usr/bin sed 's/*/( & )/' test ( cool ) ( change ) ( )Frinto Francis... (2 Replies)
Discussion started by: frintocf
2 Replies

5. Shell Programming and Scripting

Perl & Sed command -- Out of Memory Error

Experts, We used to receive our source files with '~^' as row delimiter. This file contains 2500K records and two of the columns having value in HTML formats within the file. While running the below commands against the file, we are encountering out of memory, could you please help to... (3 Replies)
Discussion started by: srivijay81
3 Replies

6. Shell Programming and Scripting

sed & areas respectively sed & pyramiding

Hello everyone, i wonder if someone could give me an advice regarding the following problem using sed. Given ist a structure as shown below: <aaa>text1<b>text2</b>text3<c>text4</c>text5</aaa> Now I want to change the outer tag from "aaa" to "new" and replace all tags inside the outer tags... (4 Replies)
Discussion started by: Donaldinho
4 Replies

7. UNIX for Dummies Questions & Answers

Question: Help need to remove blank line & sed: Couldn't re-allocate memory error.

I've shell script where i used the below command to take the line which contains patterns. sed -n "/$year 05:/,/$year 17:/p" trace.log | grep -f patterns.txt > output.log This was working fine for long time, but now a days this script is not working with and throwing error like sed:... (8 Replies)
Discussion started by: senthil.ak
8 Replies

8. Shell Programming and Scripting

Help, | ! & [ ^ in sed

Hi,everyone: I'm new to shell, and I'm confued with some script: ssum=`echo "$lsum" | sed 's|!|\\\\!|g'` line1=`echo "$line" | sed 's!\!\\\]!g'` line3=`echo "$line2" | sed 's!\&!\\\&!g'` sed "s^${line3}^${newline3}^g" ${TIER4FILE} > ${TMP_TIER4FILE} In the first three lines,... (5 Replies)
Discussion started by: mycoy
5 Replies

9. Linux

Kernal panic error& setuproot:error mounting /proc&/sys

Hi all, I am new to redhat/fedora linux. In fedora linux 6,we created one file system(hda3 - /fs). in this mount poing we were installed mounta vista os. while booting we are getting below error messages. 1) Booting 'mountaVisat(2.6.18_pro 500_pc_target-x86_586 smp)' root(hd0,1)... (2 Replies)
Discussion started by: arjunreddy3
2 Replies

10. Shell Programming and Scripting

sed & awk

Hi. I'm going to learn scripting and i have the following topics on the list: sed, awk, shell scripting, perl. My question is, whehter i should learn sed and awk? Aren't this tools outdated? Although i see that GNU upgrade it's versions of these tools from time to time. And, the next... (9 Replies)
Discussion started by: kukuruku
9 Replies
Login or Register to Ask a Question