There's a shell script by name "download", which has been created as user "mgr" and that script needs to executed as user "dev".
I tried giving privileges 701 on the script download.
But it's throwing the error message
But, when ever I tried it with 705, it works fine.
Since I have a password embedded in the script "download", I want to give execute only privileges to the other user.
Please let me know how can I achieve this.
Last edited by Scrutinizer; 02-26-2013 at 03:37 PM..
Reason: code tags
The nature of a script is that it needs to be executable and readable (by the script interpreter).
Try to switch to another user that owns the script.
Like
@panyam:
I have already tried that, but wasn't helpful.
@madeInGermany:
When I tried sudo -u mgr ./download.sh, it's prompting to enter the password of the user "mgr". As I mentioned earlier, the mgr password can't be shared.
sudo -u mgr ./download
[sudo] password for mgr:
These are the current permissions I have on the script.
ls -ltr download
-rwx--x--x 1 mgr mgr 1970 Feb 26 13:42 download
If I execute below code I am able to get string from column8 and column10 about a process.
serverA1$> ps -ef | grep rotate | grep 'config' | awk '{print $8" "$10}'
/<Oracle_home>/ohs/bin/odl_rotatelogs -h:/<app_Home>/config/OHS/ohs1/component_events.xml_ohs1... (12 Replies)
Hi,
I am having a shell script on Solaris 10 which has a while loop as shown below.
#!/usr/bin/ksh
#
while
do
sleep 60
done
Name of the shell script is coldcentric.sh. I executed script /DATAWAREHOUSE/LOAD/Scripts/coldcentric.sh from a command task in Informatica worklow as... (3 Replies)
Hi,
Shell script can be executed in few ways. I would like to know the differences in the below execution methods.
sh file1.sh
. file1.sh
. /file1.sh
Please help, thank you. (2 Replies)
Hello,
I am writing a shell script in which i do ssh to remote server and count the number of files there and then exit. After the exit the shell script terminates which i believe is expected behavior. Can some one suggest me a way where even after the exit the script execution resumes.
... (2 Replies)
Hi
I have to execute the commands in .aliases file from a shell script
I tried
1.giving the alias directly in shell script
2.Giving the actually "value of alias" in the shell script
3. I tried giving both steps 1 and 2 inside ` quotes
Still nothing is working . It says command... (3 Replies)
Hi Guys,
Unable to run this script from the cron,although the same executes perfectly from the command line.Please help.
#!/bin/sh
#### aprintd alarm creation files #####
file=`date +%m%d%Y`
pid=$$
echo "$pid"
/u01/app/netboss/bin/aprintd/aprintd > $file &
childpid=$!... (3 Replies)
Hi All,
i am running a shell script in which there is a command
`ps -ef | grep smon > db`
When i execute this command in the command prompt i am getting the desired output..but when the script is executed..the db file is getting created but with no values...I could not find the reason for... (2 Replies)
I've a shell script that invokes a URL of an application to do some work, e.g., http://www.abc.com/myservlet?action=helloworld.Does the shell wait for a return value from the URL call before proceeding to the next line of command? (6 Replies)