The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
I create user but i cant login the user i created. jerome UNIX for Dummies Questions & Answers 5 06-09-2006 02:08 PM
login to different user completely within the script yakdiver Shell Programming and Scripting 1 05-05-2005 11:08 AM
User Login Monitor Script Drewser Shell Programming and Scripting 2 02-07-2005 01:45 PM
running a script under different user Gary Dunn Shell Programming and Scripting 4 12-13-2004 03:17 PM
user login script question termiEEE UNIX for Dummies Questions & Answers 2 02-03-2004 02:34 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-24-2006
Registered User
 

Join Date: Dec 2004
Posts: 12
Running script from other user rather than login user

Hi,
My requirement is that i am login from ROOT in a script but when any
command is coming which is logging to sqlplus then i have to run it with normal user as only normal user have permission to connect to sqlplus .

i tried making a script like this :
#! /bin/ksh
su - normal_user
/normal_user/bin/x

where x is the script which is doing all sort of database activity.
but when i run it, it simply comes with normal_user prompt and doing nothing.

Please assist me in this case.

Thanks
rawat
Reply With Quote
Forum Sponsor
  #2  
Old 08-24-2006
Klashxx's Avatar
HP-UX/Linux/Oracle
 

Join Date: Feb 2006
Location: Almerķa, Spain
Posts: 383
You could try remsh
Reply With Quote
  #3  
Old 08-25-2006
Registered User
 

Join Date: Aug 2006
Posts: 122
Hi, Not sure what your script is doing but try a "here-doc"
inside your original script and not run the /bin/x script?
You can pass variables.

ie
su - user_name -c "VAR1=xxx; VAR2=abc; VAR3=${def}<< EOF
Command 1 $VAR1
Command 2 $VAR2
Command 3 $VAR3
etc etc
exit;
EOF
"
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:10 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0