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
I create user but i cant login the user i created. jerome UNIX for Dummies Questions & Answers 5 06-09-2006 05:08 PM
login to different user completely within the script yakdiver Shell Programming and Scripting 1 05-05-2005 02:08 PM
User Login Monitor Script Drewser Shell Programming and Scripting 2 02-07-2005 04:45 PM
running a script under different user Gary Dunn Shell Programming and Scripting 4 12-13-2004 06:17 PM
user login script question termiEEE UNIX for Dummies Questions & Answers 2 02-03-2004 05:34 PM

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 08-25-2006
rawatds rawatds is offline
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
  #2 (permalink)  
Old 08-25-2006
Klashxx's Avatar
Klashxx Klashxx is offline Forum Advisor  
HP-UX/Linux/Oracle
  
 

Join Date: Feb 2006
Location: Almerķa, Spain
Posts: 393
You could try remsh
  #3 (permalink)  
Old 08-25-2006
Andrek Andrek is offline
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
"
  #4 (permalink)  
Old 01-30-2009
pchangba1 pchangba1 is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 13
su - normal_user << !
/normaluser/bin/x


this works fine i have tried it
....
Sponsored Links
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 07:11 PM.


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