LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-07-2010, 09:12 AM   #1
suhai.sadaqat
LQ Newbie
 
Registered: Feb 2010
Posts: 2

Rep: Reputation: 0
Post Call other script having different Permissions


HI,

I am writing a shell script lets say run.sh and i want to call another script lets say test.sh having permissions " root:sys" whereas the permissions for run.sh are "root:other".

Problem is that i cannot change the permissions of either of them. run.sh is performing some other important functions as well and test.sh is a system script and i am not supposed to change that.

If i do not change the permissions, run.sh simply skips the part where it is suppose to call test.sh

Can anyone tell me how do i call test.sh in run.sh without changing permissions of any of them.



Code:
run.sh
#!/bin/sh
dub=`cd /opt/FJSVmadm/sbin
hrdconf -l`

check5=`grep '*' $dub`

if [ "$check5" ]
then
echo "Hardconf Status....................OK\n"
else
echo "Hardconf Status....................NOK\n"
fi

Thanks in advance
 
Old 02-07-2010, 09:43 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I've closed your duplicate thread..

Quote:
Can anyone tell me how do i call test.sh in run.sh without changing permissions of any of them.
I think there is a basic rule: You can't do something with a file where you do not have permissions. The exception is that root can do anything--regardless of permission settings. So I think the only way is to run "run.sh" as root.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Call other script having different Permissions suhai.sadaqat Linux - Newbie 2 02-07-2010 09:35 AM
ssh - using variables in call to start remote script from local script babag Linux - Networking 2 06-03-2008 05:50 PM
How can I script an autologin, automatically call kde(or simillar) and call an app aboaventura Slackware 8 02-04-2007 12:00 AM
How to call a script from a system startup script? jonatito Linux - Newbie 7 11-11-2005 10:40 PM
call another script and have the inital script exit mjtice Programming 1 09-11-2005 12:54 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration