I need to switch users in a script and keep executing commands. I thought -c would help but i don't know how to use it properly nor any idea how to do this. I wrote
bash -c "su user && command arg1 arg2"
It tried to execute the command after i typed in exit.
Hi All,
I have designed a web tool in perl cgi in UNIX Solaris 10 platform.
According to my cgi script (in server A) it should execute a script (in server B) using ssh key authentication, but it is not.
And when I am trying to execute the command without cgi script, the script in server B is executing.
I am using following command
/usr/bin/ssh -i mykey -l <login_id> <hostn
Hi I got a simple question, I want to write a shell script where I input the variable when I execute the script
for example
Code:
./script.sh var1
where it will execute script.sh using var1 as the variable, which is used in the script.
Hi,
How to restrict access to a .ksh script in such the way that the users can only execute the script, neither read nor write.
I tried the below code so that my user alone has the rwx and other users can only execute.
Code:
chmod 711 sample.ksh
But when I logged in as a different user and tried to execute the script, I get an error "Permission Denied".
How should I give the
I have searched but cannot find a working method. What I need to do is first, download a file using AsyncTask. Then I will execute a script. The thing is, the script depends on the file I'm downloading, so I need to wait for the AsyncTask to finish the download before I execute my script. I cannot find a working method for this. Sorry if I didn't search good enough.
Hello,
I am running into few issues, please suggest me what I am missing.
I am running this script on a linux host.
Main idea of this script is to, login to each host via ssh and get uid of user, service user that I trying to run this script, has already deployed ssh keys and provide sudo access to root with password less on all the server.
issue: /tmp/hostname.txt file contains list o
hi ,
:wall:
I've in directory home user 3 file with blank space in name file, I would like erase the all character that no have alphanum more dot in namefile from home root , below the script.
If I execute the shell script from directory where stay it's execute well done.But I would like execute the script from home root , like so:
/var/www/html/regia0/temp/f/./ren in this case after execute t
I have a script in Server A that will run a script in ServerB.
Code:
#!/bin/ksh/
ssh user@server "/path/script.sh"
The script permissions are as follow:
Code:
-rwxrwxrwx 1 user dba 75 Jun 11 10:00 script.sh
I checked the existence of 'ksh' in /bin and its there.
Hi,
I have a csh script. I want to set some variables and execute some command from a file in that script.
abc.csh
Code:
echo "primary script"
b
Code:
setenv XXX ddd
set XX
make abc
I want to execute the commands of "b" file from abc.csh.