Sponsored Content
Homework and Emergencies Emergency UNIX and Linux Support Seek help on shell script syntax errors Post 302543900 by duke0001 on Tuesday 2nd of August 2011 11:48:22 AM
Old 08-02-2011
Thanks so much for your advice. My Unix platform is HP UNIX 64 bit. I am runing this shell script on standby database to delete applied archivelog files from primary and standby both.

I tried to use getent command. But it seems not exist on HP UNIX machine. So I tried to use pwget and grget as this:

Code:
> pwget -u /etc/passwd

I got

Code:
>root:x:0:3:System Administrator:/home/root:/sbin/sh

Please advise.

---------- Post updated at 11:19 AM ---------- Previous update was at 11:05 AM ----------

On the Linux box, I run getent

Code:
>getent passwd, Then I got

>oracle:x:501:501:Oracle Administrator:/home/oracle:/bin/bash

---------- Post updated at 11:48 AM ---------- Previous update was at 11:19 AM ----------

I comment out "PATH=$PATH:$ORACLE_HOME/bin export PATH", then I run again. I got this

Code:
Recovery Manager: Release 10.2.0.4.0 - Production on Tue Aug 2 11:29:00 2011

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: EXPRD (DBID=4037707233, not open) connected to recovery catalog database

RMAN> 2> 3> 4> 
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found ";": expecting one of: "integer"
RMAN-01007: at line 4 column 43 file: standard input

RMAN> 2> 
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "}": expecting one of: "allocate, alter, backup, beginline, blockrecover, catalog, change, connect, copy, convert, create, crosscheck, configure, duplicate, debug, delete, drop, exit, endinline, flashback, host, {, library, list, mount, open, print, quit, recover, register, release, replace, report, renormalize, reset, restore, resync, rman, run, rpctest, set, setlimit, sql, switch, spool, startup, shutdown, send, show, test, transport, upgrade, unregister, validate"
RMAN-01007: at line 2 column 1 file: standard input

RMAN> 

Recovery Manager complete.


Last edited by pludi; 08-02-2011 at 03:41 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK Syntax errors :/

I recently started as an intern and my manager wanted to see how well I would handle Korn Bourne shell scripting without any prior experience, I have prior programming experience but I keep running into syntax errors with AWK. Please take a look at my simple code and tell me what stupid mistake... (6 Replies)
Discussion started by: yongho
6 Replies

2. Shell Programming and Scripting

Parse for errors shell script

All, I have a shell script which parses the /var/adm/messages file for errors every 15 minutes as a cron job. The script runs at 01, 16, 31, and 46 minutes every hour. The problem is if the error is encountered any time during the beginning of hour I can get paged three times. I would like to... (2 Replies)
Discussion started by: bubba112557
2 Replies

3. Shell Programming and Scripting

Help with shell script errors

hey watsup guys i am new in the shell script world. so i need help fom you guys, i have written these two codes and they both give the same errors( expr : syntax error). Code 1 : #! /bin/sh # count1 appends an increment to a file 200 times # note that a file called numbers must be... (5 Replies)
Discussion started by: surubi_abada
5 Replies

4. Shell Programming and Scripting

perl version for syntax errors

All, Does it matter what perl verios your running when you get syntax errors? on version 5.6.1 the code works fine, but on 5.8.0 the code gets errors? #!/usr/bin/perl #use strict; #use warnings; my $mess = 'messages'; my $mess1 = 'messages.1'; my $mess2 = 'messages.2'; my... (13 Replies)
Discussion started by: bigben1220
13 Replies

5. Shell Programming and Scripting

PERL Syntax Errors

Hi, I am a newbie to PERL and working on a script. When running it I get a lot of compilation errors. The actual command in the program (which is within a case structure) is given below # This gives the actual count of inquires from a log file (It works fine when I type this on the... (2 Replies)
Discussion started by: nurani
2 Replies

6. Shell Programming and Scripting

line count with if /else - syntax errors

this is the script: ps -ef|grep "x_jobstat 10 v001" > jobstatv001.txt ps -ef |grep "x_jobserver 10 v001" >> jobstatv001.txt #Sample text - each line preceded by 4 spaces # root 133064 102986 0 08:49:28 pts/6 0:00 grep x_jobstat 10 v001 # root 137550 1 0 Nov 08 - 0:28... (6 Replies)
Discussion started by: kwalkner
6 Replies

7. Shell Programming and Scripting

shell script for conky getting errors....

So I have a script that does a greater than or less than with a variable. My problem is that when I checked the script from the command line I was getting this error.. I am not really familiar with shell scripting. I am trying to get this script to work with conky so that it will do the... (8 Replies)
Discussion started by: krisdeniseriley
8 Replies

8. Shell Programming and Scripting

How to turn off ora errors in shell script?

I have a shell script which select total count from a table and use its value in a if condition like below connect_string="username/password@tnsname" tot=`sqlplus -s $connect_string << EOF set echo off set feedback off set head off select count(*) from test_table; EOF ` if then echo... (2 Replies)
Discussion started by: vel4ever
2 Replies

9. Shell Programming and Scripting

Converting from Linux bash (GNU) to Solaris script syntax errors

Original script written on CentOS 6.3 with GNU bash 4.1.2 Destination system is Solaris 9 with GNU bash 2.05 (not changeable by me) I have a script written on the linux side but now we need to provide a version to another site that "doesn't like linux". I've been going through changing the ] or... (13 Replies)
Discussion started by: oly_r
13 Replies

10. Homework & Coursework Questions

Help with shell scrip syntax errors

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: This script will analyse the channels.txt e registrations.txt and it will allow to mage the channels and the... (9 Replies)
Discussion started by: Demas
9 Replies
RMAN(9) 						   BSD Kernel Developer's Manual						   RMAN(9)

NAME
rman, rman_activate_resource, rman_await_resource, rman_deactivate_resource, rman_fini, rman_init, rman_manage_region, rman_release_resource, rman_reserve_resource, rman_reserve_resource_bound, rman_make_alignment_flags, rman_get_start, rman_get_end, rman_get_device, rman_get_size, rman_get_flags, rman_set_virtual, rman_get_virtual, rman_set_bustag, rman_get_bustag, rman_set_bushandle, rman_get_bushandle, rman_set_rid, rman_get_rid -- resource management functions SYNOPSIS
#include <sys/rman.h> int rman_activate_resource(struct resource *r); int rman_await_resource(struct resource *r, int pri2, int timo); int rman_deactivate_resource(struct resource *r); int rman_fini(struct rman *rm); int rman_init(struct rman *rm); int rman_manage_region(struct rman *rm, u_long start, u_long end); int rman_release_resource(struct resource *r); struct resource * rman_reserve_resource(struct rman *rm, u_long start, u_long end, u_long count, u_int flags, struct device *dev); struct resource * rman_reserve_resource_bound(struct rman *rm, u_long start, u_long end, u_long count, u_long bound, u_int flags, struct device *dev); uint32_t rman_make_alignment_flags(uint32_t size); u_long rman_get_start(struct resource *r); u_long rman_get_end(struct resource *r); struct device * rman_get_device(struct resource *r); u_long rman_get_size(struct resource *r); u_int rman_get_flags(struct resource *r); void rman_set_virtual(struct resource *r, void *v); void * rman_get_virtual(struct resource *r); void rman_set_bustag(struct resource *r, bus_space_tag_t t); bus_space_tag_t rman_get_bustag(struct resource *r); void rman_set_bushandle(struct resource *r, bus_space_handle_t h); bus_space_handle_t rman_get_bushandle(struct resource *r); void rman_set_rid(struct resource *r, int rid); int rman_get_rid(struct resource *r); DESCRIPTION
The rman set of functions provides a flexible resource management abstraction. It is used extensively by the bus management code. It imple- ments the abstractions of region and resource. A region descriptor is used to manage a region; this could be memory or some other form of bus space. Each region has a set of bounds. Within these bounds, allocated segments may reside. Each segment, termed a resource, has several proper- ties which are represented by a 16-bit flag register, as follows. #define RF_ALLOCATED 0x0001 /* resource has been reserved */ #define RF_ACTIVE 0x0002 /* resource allocation has been activated */ #define RF_SHAREABLE 0x0004 /* resource permits contemporaneous sharing */ #define RF_TIMESHARE 0x0008 /* resource permits time-division sharing */ #define RF_WANTED 0x0010 /* somebody is waiting for this resource */ #define RF_FIRSTSHARE 0x0020 /* first in sharing list */ #define RF_PREFETCHABLE 0x0040 /* resource is prefetchable */ The remainder of the flag bits are used to represent the desired alignment of the resource within the region. The rman_init() function initializes the region descriptor, pointed to by the rm argument, for use with the resource management functions. It is required that the fields rm_type and rm_descr of struct rman be set before calling rman_init(). The field rm_type shall be set to RMAN_ARRAY. The field rm_descr shall be set to a string that describes the resource to be managed. It also initializes any mutexes associ- ated with the structure. If rman_init() fails to initalize the mutex, it will return ENOMEM; otherwise it will return 0 and rm will be ini- talized. The rman_fini() function frees any structures associated with the structure pointed to by the rm argument. If any of the resources within the managed region have the RF_ALLOCATED flag set, it will return EBUSY; otherwise, any mutexes associated with the structure will be released and destroyed, and the function will return 0. The rman_manage_region() function establishes the concept of a region which is under rman control. The rman argument points to the region descriptor. The start and end arguments specify the bounds of the region. If successful, rman_manage_region() will return 0. If the region overlaps with an existing region, it will return EBUSY. ENOMEM will be return when rman_manage_region() failed to allocate memory for the region. The rman_reserve_resource_bound() function is where the bulk of the rman logic is located. It attempts to reserve a contiguous range in the specified region rm for the use of the device dev. The caller can specify the start and end of an acceptable range, as well as alignment, and the code will attempt to find a free segment which fits. The start argument is the lowest acceptable starting value of the resource. The end argument is the highest acceptable ending value of the resource. Therefore, start + count - 1 must be <= end for any allocation to happen. The default behavior is to allocate an exclusive segment, unless the RF_SHAREABLE or RF_TIMESHARE flags are set, in which case a shared segment will be allocated. If this shared segment already exists, the caller has its device added to the list of consumers. The rman_reserve_resource() function is used to reserve resources within a previously established region. It is a simplified interface to rman_reserve_resource_bound() which passes 0 for the flags argument. The rman_make_alignment_flags() function returns the flag mask corresponding to the desired alignment size. This should be used when calling rman_reserve_resource_bound(). The rman_release_resource() function releases the reserved resource r. It may attempt to merge adjacent free resources. The rman_activate_resource() function marks a resource as active, by setting the RF_ACTIVE flag. If this is a time shared resource, and the caller has not yet acquired the resource, the function returns EBUSY. The rman_deactivate_resource() function marks a resource r as inactive, by clearing the RF_ACTIVE flag. If other consumers are waiting for this range, it will wakeup their threads. The rman_await_resource() function performs an asynchronous wait for a resource r to become inactive, that is, for the RF_ACTIVE flag to be cleared. It is used to enable cooperative sharing of a resource which can only be safely used by one thread at a time. The arguments pri and timo are passed to the rman_await_resource() function. The rman_get_start(), rman_get_end(), rman_get_size(), and rman_get_flags() functions return the bounds, size and flags of the previously reserved resource r. The rman_set_bustag() function associates a bus_space_tag_t t with the resource r. The rman_get_bustag() function is used to retrieve this tag once set. The rman_set_bushandle() function associates a bus_space_handle_t h with the resource r. The rman_get_bushandle() function is used to retrieve this handle once set. The rman_set_virtual() function is used to associate a kernel virtual address with a resource r. The rman_get_virtual() function can be used to retrieve the KVA once set. The rman_set_rid() function associates a resource identifier with a resource r. The rman_get_rid() function retrieves this RID. The rman_get_device() function returns a pointer to the device which reserved the resource r. SEE ALSO
bus_activate_resource(9), bus_alloc_resource(9), bus_release_resource(9), bus_set_resource(9), mutex(9) AUTHORS
This manual page was written by Bruce M Simpson <bms@spc.org>. BSD
April 29, 2007 BSD
All times are GMT -4. The time now is 04:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy