0
votes
1answer
508 views

sudo: source: command not found when executing tcl as sudo

I have a test.tcl (has all permissions) which contains the following- #!/usr/bin/tclsh puts "hello, world" This is how I'm executing my tcl script- sudo source /opt/test.tcl I got the ...
5
votes
3answers
2k views

Automatically execute bash script under the privileges of another user

Is there a way to execute a bash script under the privileges of another user (automatically)? I think "sudo" is the right way, but I don't know how to automate the process. E.g. I want to run ...
1
vote
3answers
543 views

Use sudo command for script SSH server

I have to do following steps on several servers: log in with my username type in sudo su - type in amCLI -l 32/1 | grep Firmware So I would like to write this all in one script, my idea was: ...
1
vote
1answer
1k views

How to run python script on startup with sudo permission on Mac OS

I have created a script with python that basically ping all servers found in my lists. I need this script to be run on startup with sudo permission. So the question is, How do you run the script on ...
2
votes
2answers
1k views

Get the user's home when sudo-ing in a script ran by root

In the manpage of sudo I found the -H option, but I don't seem to understand how it works. The manpage says: The -H ( HOME ) option sets the HOME environment variable to the homedir of the ...
1
vote
1answer
1k views

How do I run a SVN post-commit script as root?

I have a SVN repository server that runs under the repository user, and I want to run a script after every post-commit action. I therefore wrote a shell script that runs from the hook after every ...
1
vote
2answers
570 views

GNU/screen not setting $STY

I'm trying to script the spawning of GNU/screen windows by using commands of the form screen <CMD>. For some reason when I start GNU/screen (by hand), the shell that it starts in window 0 ...
3
votes
4answers
2k views

sudo displays typed password in bash script

I have a bash script that uses sudo a few times. There's a couple of strange points about it though. It asks me for my password a few seconds after I've already entered it for a previous command. ...
2
votes
5answers
3k views

Problem with running a script at startup as root?

The main question: Is there a way I can run 'completely' one of my script when ubuntu's desktop appears no matter if root , administrator, desktop user or an unprivileged user logged in? What does ...
28
votes
2answers
32k views

SSH: execute sudo command

I have an interactive shell script, that at one place needs to ssh to another machine (Ubuntu based) and execute something as root (the user should enter his password, but the remote command should ...