11-25-2009
Help Passing An Oracle parameter to a unix shell.
I have an Oracle concurrent program that I'm passing a parameter to a unix shell script. An example value of the Oracle parameter is PO_TOP. The Oracle parameter represents the unix env var PO_TOP, meaning, on the unix side there is env var called PO_TOP (ex value: /oradev/apps/po/11.0.3/). My goal is to passed the Oracle parameter to the unix script and have it behave like the unix env var $PO_TOP.
Example of the code in the script.
ora_base_dir=$1
echo "ora_base_dir: "$ora_base_dir
cd $ora_base_dir
--
This fails with a directory does not exist
the echo displays "ora_base_dir: PO_TOP"
Here is some examples of the not so brilliant stuff that I have tried:
ora_base_dir=$$1
ora_base_dir=$\$1
ora_base_dir=${$1}
All failed.
Can you pass the name of a unix env variable to a unix shell script and then set a new unix var to the passed variable?
Note: I'm trying to avoid using
IF $1= 'PO_TOP' THEN
ora_base_dir=$PO_TOP
ELSIF $1 = 'FND_TOP' THEN
ora_base_dir=$FND_TOP.....etc
There are over 200 unix TOP variables.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have a 2 files. File1 i am generating using an ETL tool, which is a comman seperated delimited file which contains country code & load date.
everytime, this country code will be updated from a table. It might be AB or BA & ld_date will be for which date we need to load the file.
... (7 Replies)
Discussion started by: Amit.Sagpariya
7 Replies
2. AIX
I would like to run a compress script on files in certain directories.
My compress_script.sh is just basically
compress file*
In order for me to use this I have to copy it into each directory and run it.
How can I state the directory on the command line with the compress script so it... (2 Replies)
Discussion started by: NycUnxer
2 Replies
3. SCO
OS SCO Open Server 6.0 MP4
I am trying to change the value of a enviornment variable thru a script and want to pass a parameter on the commande line, If I hard code the value inside the script the script changes the enviornment variable
. mytest
where my test is
MYVAR=$1
export MYVAR... (6 Replies)
Discussion started by: atish0
6 Replies
4. Shell Programming and Scripting
Hi,
I have one shell script which use two parameter however one of its parameter have space in between.
eg.
a.sh 20110114 b c d
here b c d is one parameter
I used 'b c d' but its not giving correct result.
Also i tried b\c\d but this one also didnt work.
Any help would be... (5 Replies)
Discussion started by: diehard
5 Replies
5. Shell Programming and Scripting
Hi All,
i've a shell script, where it will run in the background, i'm using.
system("sh $Home/S_SCRIPT/cck.sh $shell_dum_file &");
i'm passing a parameter $shel_dum_file to the background process.
In shell script , i'm using.
#!/bin/sh
FILE=$1
echo "FILE NAME- $FILE"
this shell... (2 Replies)
Discussion started by: asak
2 Replies
6. Shell Programming and Scripting
Hi,
I have a function which connects to the db and runs the sql.
it works fine when I run it like: function "select empname from emp;"
but when I try to pass the sql string to a variable which in turn in fed to the function , it throws error.
please advise.
Thanks,
Arnie. (1 Reply)
Discussion started by: itsarnie
1 Replies
7. Shell Programming and Scripting
Hi All,
I'm new to Linux and scripting, apologies in advance for 'stupid' questions.
Please help... Im writing a script that calls a sqlplus script but the sqlplus requires inputs and i cant seem to get this to work.
here is my code.
#!/bin/sh
TERM=vt100
export TERM... (4 Replies)
Discussion started by: Mahomed
4 Replies
8. Shell Programming and Scripting
Hello All,
I am trying below
+++++++++
#/bin/bash
set -x
Host=$1
Port=$2
User=$3
Pass=$4
Warning=$5
Critical=$6
SCRIPT_LOC=/opt/agent/
Parameters="'""hostname=$Host&""port=$Port&""username=$User&""password=$Pass&""jvm=UsedMemory,$Warning,$Critical""'"
echo $Parameters... (10 Replies)
Discussion started by: sundari127
10 Replies
9. Shell Programming and Scripting
Good afternoon, i need your help pls
I want to write a new script that start running as soon as a previus one finish via Autosys (it should be implemented via Autosys too to validate the exsitance and the successful transfered file to a remote server
Whenever the file arrives to the path... (2 Replies)
Discussion started by: alexcol
2 Replies
10. UNIX for Beginners Questions & Answers
Hello,
I have researched and tried many way to pass OUT parameter to be stored in variable in KSH Script.Still not success, please help.
Here is my Store Procedure.
create procedure testout3(v_in varchar2,v_out OUT integer)
as
begin
v_out := 1;
end;
Here is my testvout.ksh
#!/bin/ksh... (1 Reply)
Discussion started by: palita2601
1 Replies
ARCHIVE(8) System Manager's Manual ARCHIVE(8)
NAME
archive - Usenet article archiver
SYNOPSIS
archive [ -a archive ] [ -f ] [ -i index ] [ -m ] [ -r ] [ input ]
DESCRIPTION
Archive makes copies of files specified on its standard input. It is normally run either as a channel feed under innd(8), or by a script
before expire(8) is run.
Archive reads the named input file, or standard input if no file is given. The input is taken as a set of lines. Blank lines and lines
starting with a number sign (``#'') are ignored. All other lines should specify the name of a file to archive. If a filename is not an
absolute pathname, it is taken to be relative to /var/spool/news.
Files are copied to a directory within the archive directory, /var/spool/news/news.archive. The default is to create a hierarchy that mim-
ics the input files; intermediate directories will be created as needed. For example, the input file comp/sources/unix/2211 (article 2211
in the newsgroup comp.sources.unix) will be copied to /var/spool/news/news.archive/comp/sources/unix/2211.
OPTIONS
-a archive
If the ``-a'' flag is used then its argument specifies the directory to archive in instead of the default.
-f If the ``-f'' flag is used, then all directory names will be flattened out, replacing the slashes with periods. In this case, the
file would be copied to /var/spool/news/news.archive/comp.sources.unix/2211.
-i If the ``-i'' flag is used, then archive will append one line to the specified index file for each article that it copies. This
line will contain the destination name and the Message-ID and Subject headers.
-m Files are copied by making a link. If that fails a new file is created. If the ``-m'' flag is used, then the file will be copied
to the destination, and the input file will be replaced with a symbolic link pointing to the new file.
-r By default, archive sets its standard error to /var/log/news/errlog. To suppress this redirection, use the ``-r'' flag.
EXIT STATUS
If the input is exhausted, archive will exit with a zero status. If an I/O error occures, it will try to spool its input, copying it to a
file. If there was no input filename, the standard input will be copied to /var/spool/news/out.going/archive and the program will exit.
If an input filename was given, a temporary file named input.bch (if input is an absolute pathname) or /var/spool/news/out.going/input.bch
(if the filename does not begin with a slash) is created. Once the input is copied, archive will try to rename this temporary file to be
the name of the input file, and then exit.
EXAMPLES
A typical newsfeeds(5) entry to archive most source newsgroups is as follows:
source-archive
:!*,*sources*,!*wanted*,!*.d
:Tc,Wn
:/usr/lib/news/bin/archive -f -i
/usr/spool/news/news.archive/INDEX
HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. This is revision 1.14, dated 1996/10/29.
SEE ALSO
newsfeeds(5).
ARCHIVE(8)