The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ssh - passing password in shell script Muktesh Shell Programming and Scripting 5 05-05-2009 12:37 PM
passing values from sql to shell script sachin.gangadha Shell Programming and Scripting 3 04-22-2008 11:11 PM
Passing arguments to a shell script from file while scheduling in cron weblogicsupport SUN Solaris 4 01-27-2008 11:16 PM
passing two variables into a shell script? Bashar Shell Programming and Scripting 2 05-15-2007 10:00 AM
passing awk variable to the shell script bcheaib Shell Programming and Scripting 3 07-21-2004 10:00 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-27-2004
dreams5617 dreams5617 is offline
Registered User
  
 

Join Date: Jul 2004
Location: USA
Posts: 52
Arrow Exporting variable ## !!!!!! ####

I have a shell script which takes at the command prompt options like
ss1.sh -F SCOTT -T JOHN

F- From User
T- To User

I want to pass the From User(SCOTT) Value to another script
ss2.pls (This script runs a PL/SQL Program). Depending on the FromUser value in the ss1.sh script i have to code accordingly in the ss2.pls script.
How can i pass the FromUser Value in the ss1.sh to ss2.pls script.

Exec Sequence: First ss1.sh script is run then ss2.pls is run.

Thanks !

Last edited by dreams5617; 11-29-2004 at 12:36 PM..
  #2 (permalink)  
Old 11-27-2004
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
ssh1.sh cannot affect the environment of its parent. Maybe ssh1.sh can write a temporary file which ssh2.sh can then read.
  #3 (permalink)  
Old 11-28-2004
google's Avatar
google google is offline Forum Advisor  
Moderator
  
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
Why not call the stored procedure from within ssh1 script rather than write 2 seperate scripts? Wouldn't this solve your problem?
  #4 (permalink)  
Old 11-30-2004
dreams5617 dreams5617 is offline
Registered User
  
 

Join Date: Jul 2004
Location: USA
Posts: 52
Arrow Passing value from shell script to .pls file

I have a shell script which takes at the command prompt options like
ss1.sh -F SCOTT -T JOHN

F- From User
T- To User

Inside the ss1.sh there is a call to ss2.sh(inside this shell script there is a call to proced.pls, in this program(proced.pls) i have to pass the T -Touser value from the ss1.sh shell script).
Ex:
vi ss1.sh
{
Function()
{
/db2/home/ss2.sh $ORACLE_SID
}
}

vi ss2.sh
{
sqlplus -s / as sysdba << !
set verify off
@/db2/home/proced.pls
}

vi proced.pls
{
declare
cursor sym_owner is select owner from all_synonyms where owner=UPPER('$ToUser'); -- I want the value of ToUser taken
-- from ss1.sh script here in the SQL
-- statement.
..........................................................................etc

}
ss2.pls (This script runs a PL/SQL Program). Depending on the ToUser value in the ss1.sh script i have to code accordingly in the ss2.pls script.
How can i pass the ToUser Value in the ss1.sh to ss2.pls script.



Thanks !

red red red
  #5 (permalink)  
Old 11-30-2004
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
I have merged this with the thread you started when you asked the same question several days ago. Please read the rules particularly the ones regarding bumping posts and cross/duplicate posting.

Why can't you just do something along the lines of
Code:
$ cat > ss1.sh
#!/bin/sh
touser=$1
ss2.sh $touser
^D
$ cat > ss2.sh
#!/bin/sh
echo "Inside ss2.sh> $1"
^D
$ chmod +x ss1.sh
$ chmod +x ss2.sh
$ ./ss1.sh foouser
Inside ss2.sh> foouser
You get the idea - or do what google suggested and just write the whole thing as one single script - why pass variables around anyway?!

Cheers
ZB
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:00 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0