Trojan.
It was considered, however during initial trials "bob's" variables were not passed to workstationA and the script wouldn't run. We kept getting an exit value of 1 : (syntax or usage error).
I should have mentioned that in my first post.
Thanks for the thought though.
scfc
Further to my last post I have an updated version which works well and every time. The last one seemed tempremental. Anyway here goes:-
ssh -C workstationA 'su - bob -c "/path/to/script"'
Hope it helps someone else!!
The only difference that I can tell is the positioning of the quotation marks.
We both previously had placed the quotes prior to the su command.
eg ssh -n workstationA "su - bob -c /path/to/script"
The one I have now is:-
ssh -n workstationA su - bob -c "/path/to/script"
A subtle difference...
I managed to find an old scripts hidden in our archive and found the following:-
su - bob -c "/path/to/script"
That has done the trick.
Thanks to both of you for your input.
I probably to the syntax too literally.
However further study has found that bob didn't become the user to run the script and the ownership of the output belongs to root.
I may try to add a script on workstationA that will su - bob and then run the script from within that script. It probably...
Tried that but had error: unexpected end of file.
However tried a variation on it and got the result I was after.
ssh -n workstationA "su - bob; /path/to/script"
Thanks for the help.
scfc1976
I am trying to automate a process of copying files from a CD over a network from a host to a remote terminal.
Due to the security setup we have I need to SSH as root.
However the commands to run a script need the environment of a different user in order to run correctly.
I have tried the...
Thanks for the response. I kept getting syntax errors,
(probably due to seat to keyboard interface), however I mangaed to sort the problem after a bit of a lay off.
My code was:-
#! /bin/sh
cd /home
for file in *
do
if [ -f $file ]
then
ucfile=`echo $file | tr '[:upper:]'...
Hi all,
I have been looking at various threads in relation to this and haven't been able to get the right result. The closest I have got was to turn all uppercase characters within a file to lowercase.
What I need is to change the filename of various files (the amount of which can change at...
Hi all.
As a new user of AWK and a inexperienced programmer I could use a bit of help with a little problem.
I have a file that could change depending on what users are acessing the file. This file is then used to update information on a database.
File example:
"Text","data","word","word1"...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.