04-18-2012
Thanks jlliagre , I was having a bit of an off-day when I posted that!
Back on topic:
Quote:
@/opt/oracle/scripts/sql/arch_del_$ORACLE_SID_pri.sql
rman target sys/$SPW@MYDB_primary log /opt/oracle/logs/arch_del_$ORACLE_SID_pri
.log << EOF
@/opt/oracle/scripts/rman/arch_del_$ORACLE_SID_pri.rcv
cat /opt/oracle/logs/arch_$ORACLE_SID_pri.log >> $RMAN_LOG_FILE
In each of these lines the substitution of
$ORACLE_SID does not work (Shell looks for a variable called
$ORACLE_SID_pri ). It should probably be
${ORACLE_SID}_pri .
Quote:
if [ "$RSTAT" = "0" ]
then
mailx -s "MYDB archivelog backup and deletion completed successfully"
developer@ABC.com < $RMAN_LOG_FILE
else
mailx -s "MYDB archivelog backup and deletion ended in error"
developer@ABC.com < $RMAN_LOG_FILE
There is a
fi missing in this if-then-else-fi statement.
As jlliagre deduces, the main problem is in the unposted portion of the script which probably has an errorneous Here Document with a missing or extra quote which is causing the rest of the script to be treated as data (hence no error for the missing "fi").
If your style is consistent you might find it with:
[CODE]grep "EOF" scriptname | sed -n l[/EOF]
The sed is designed to make end-of-line and control characters visble. A common issue is extraneous characters around the Here Document start or end string.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I ran the following scripts and everytime i get the errot as follows
Line 54: unexpected EOF while looking for matching ','
line 57 syntex error unexpected end of file#!/bin/ksh
set -x
BKUP_DIR=/u03/backups/abu/nightly_backup
LOG_FILE=/u03/backups/abu/backup.log
ORACLE_HOME=... (9 Replies)
Discussion started by: manna
9 Replies
2. Shell Programming and Scripting
I have a trouble in my script when i use EOF inside block if.
If i use EOF whitout block if I don´t have problem.
Guys any ideas?
Sorry for my terrible English.
#!/bin/sh
set -xv
HOST='ftp.fiction.com.br'
USER='fictionuser'
PASS='fictionpass'
FILE='ftpteste.txt'
busca=`find... (4 Replies)
Discussion started by: ricardo.ludwig
4 Replies
3. Shell Programming and Scripting
Hi everyone,
I am trying to search for a string in a file that is partly made up of a variable. Here's the code:
echo "parentCategory = $parentCategory"
echo "parentCategoryFormatted = $parentCategoryFormatted"
numUrlsFoundInParentCategory=`grep -c "<Topic r:id=\"Top\/World\/Français\/"... (2 Replies)
Discussion started by: BlueberryPickle
2 Replies
4. Shell Programming and Scripting
hello everyone...im having this problem with unexpected EOF with line 85 which is..i cant see whats wrong with it..can any1 plz help me out.
read -p "$p1 please enter the number of tries you wish to have:" lifeline
function main()
{
guessnum=0
read -p "Please... (6 Replies)
Discussion started by: Freakhan
6 Replies
5. UNIX for Dummies Questions & Answers
hello everyone...im having this problem with unexpected EOF with line 85 which is..i cant see whats wrong with it..can any1 plz help me out.
read -p "$p1 please enter the number of tries you wish to have:" lifeline
function main()
{
guessnum=0
read -p "Please enter if its sinle player game... (1 Reply)
Discussion started by: Freakhan
1 Replies
6. Shell Programming and Scripting
Hi,
can someone kindly look into my copy script and figure out why am i getting a "unexpected EOF while looking for matching `"' error message
#!/bin/ksh -x
cd /home/goldenga/test/flag37
if ; then
rm copied.ok
cd /home/goldenga/test
Upper=`ls -t|grep 'qw*'|cut -d "w" -f 2|head... (4 Replies)
Discussion started by: NDalal007
4 Replies
7. Shell Programming and Scripting
Hi everyone, I'm really new in shell scripting and having trouble resolving this error.
Can someone please tell me why I'm getting these errors?
Error Message:
./test.sh: line 50: unexpected EOF while looking for matching `''
./test.sh: line 53: syntax error: unexpected end of file
... (4 Replies)
Discussion started by: simonirang
4 Replies
8. Shell Programming and Scripting
Since cPanel does not support deleting emails older then X amount of days I am using the following on a Cron Job.
find -P /home/user/mail/domain/ -mindepth 2 -mtime '+366' -type f -printf '"%p"\n' | grep -v '/Important' | grep -v '/.Important' | xargs -I {} rm -r "{}"
Executing it via SSH... (4 Replies)
Discussion started by: tiagom
4 Replies
9. Shell Programming and Scripting
I am trying to get grep with awk command into variable.
But facing error.
Could someone pls help.
$ cat test_file
DEPLOYMENT="abc" # com
cluster="bcn"
$ grep DEPLOYMENT test_file | awk -F "\"" '{ print $2 }'
abc
$ a=`echo "grep DEPLOYMENT test_file | awk -F \"\\\"\" '{ print $2 }'"` ;... (6 Replies)
Discussion started by: Manasa Pradeep
6 Replies
10. SCO
Hi, I am a new Unix Guru with very little experience but have the task of P2Ving an old HP Proliant ML370 G5 server to VMware ESX 4.1 or ESXi 5.5.
System seems to boots fine but when trying to remove HP software, configure TCP/IP or a driver, I am receiving:
--------
... (7 Replies)
Discussion started by: dj_Italian
7 Replies
LEARN ABOUT OSX
platform::shell
platform::shell(n) Tcl Bundled Packages platform::shell(n)
__________________________________________________________________________________________________________________________________________________
NAME
platform::shell - System identification support code and utilities
SYNOPSIS
package require platform::shell ?1.1.4?
platform::shell::generic shell
platform::shell::identify shell
platform::shell::platform shell
_________________________________________________________________
DESCRIPTION
The platform::shell package provides several utility commands useful for the identification of the architecture of a specific Tcl shell.
This package allows the identification of the architecture of a specific Tcl shell different from the shell running the package. The only
requirement is that the other shell (identified by its path), is actually executable on the current machine.
While for most platform this means that the architecture of the interrogated shell is identical to the architecture of the running shell
this is not generally true. A counter example are all platforms which have 32 and 64 bit variants and where a 64bit system is able to run
32bit code. For these running and interrogated shell may have different 32/64 bit settings and thus different identifiers.
For applications like a code repository it is important to identify the architecture of the shell which will actually run the installed
packages, versus the architecture of the shell running the repository software.
COMMANDS
platform::shell::identify shell
This command does the same identification as platform::identify, for the specified Tcl shell, in contrast to the running shell.
platform::shell::generic shell
This command does the same identification as platform::generic, for the specified Tcl shell, in contrast to the running shell.
platform::shell::platform shell
This command returns the contents of tcl_platform(platform) for the specified Tcl shell.
KEYWORDS
operating system, cpu architecture, platform, architecture
platform::shell 1.1.4 platform::shell(n)