Problem with SU or SSH in shell script


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Problem with SU or SSH in shell script
# 1  
Old 01-24-2006
Problem with SU or SSH in shell script

Hi Floks!
This is Sravan!
I am new to linux and I am trying to write bash shell script in which I want to change the user but the statements which are after the "su " command are not working that I mean I want to execute some statements as the changed user


here is the code


ls
su <<username>>
ls

this code is executing but I am unable to execute the nxt cmd to su


please some one help me as I am running out of time



Thanks In Advance
Sravan Reddy
India
# 2  
Old 01-24-2006
HI ,
Please add the following line to u r code as.There shld be -- followed by su
su -- <<username>>
# 3  
Old 01-24-2006
Please read our rules which state:
(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post where your goal is to get an answer more quickly.

I will close this duplicate thread.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem with ssh script

I want to execute below the script for remote server.i am not able to execute below the script please help me urgent for this issue.i getting below the error ssh user@server<<EOJ cd path for i in * do echo $i done EOJ Pseudo-terminal will not be allocated because stdin is not a... (1 Reply)
Discussion started by: SAUD PASHA
1 Replies

2. UNIX for Advanced & Expert Users

SSH using shell script terminates the script execution

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)
Discussion started by: manaankit
2 Replies

3. Shell Programming and Scripting

How to use ssh execute other shell script on other host (shell script include nohup)?

i want use ssh on the host01 to execute autoexec.sh on the host02 like following : host01> ssh host02 autoexec.sh autoexec.sh include nohup command like follwing : nohup /home/jack/deletedata.sh & after i execute ssh host02 autoexec.sh one the host01. i can't found deletedata.sh... (1 Reply)
Discussion started by: orablue
1 Replies

4. UNIX for Advanced & Expert Users

(t)c shell problem and ssh

I have recently discovered an annoying problem with some of our Linux boxes (running Opensuse 11.3) that is defying our attempts to resolve. If I (or anyone else using c shell) log in remotely to 2 of our Opensuse 11.3 machines with ssh, then they cannot run a lot of software. It seems that... (1 Reply)
Discussion started by: asharff
1 Replies

5. UNIX for Dummies Questions & Answers

Error Executing a script(SSH problem)

Hi i m writing a script which will fetch data from different machines and display it on single terminal. I have created a file named SERVERNAMES containing ip address of machines i need to monitor. Then for every IP i m issuing ssh command to get date on that machine. However When i m trying... (3 Replies)
Discussion started by: pinga123
3 Replies

6. Shell Programming and Scripting

Problem using ssh inside script

Hi, When runnin the following script it complte successfully with out any problem #!/bin/sh SERV="crm1" for s in $SERV do export WebLogicSessions=`ssh psoft@$s "cd /software/psoft/scripts ; ./getweblogicsessions.sh crm1 8001 PIA | awk '{print $1}' ` echo "Checking number of... (0 Replies)
Discussion started by: yoavbe
0 Replies

7. Shell Programming and Scripting

ssh in shell script

Hi all, I am trying to write a script in shell which can connect me to a remote server and run some commands my problem is i cant pass the password barrier.I read a lot of articles where bloggers have suggested not to use telnet and to use something more secure like ssh.I tried ssh but as soon... (8 Replies)
Discussion started by: pistachio
8 Replies

8. Shell Programming and Scripting

ssh using shell script

I need to ssh a server using shell script and run certain commands there. Please let me know how to do it . Thanks! (4 Replies)
Discussion started by: asth
4 Replies

9. Shell Programming and Scripting

Problem with executing script using ssh

I'm writing a script which is meant to ssh into a remote machine, sed a file there, and write the output to a new file on the remote machine. Obviously the easy way to do this is to write and execute the script on the remote machine, but I'm trying to do this all via ssh since I like to keep and... (4 Replies)
Discussion started by: maethlin
4 Replies

10. Shell Programming and Scripting

ssh script problem problem

Hi Please help me with the following problem with my script. The following block of code is not repeating in the while loop and exiting after searching for first message. input_file ========== host001-01 host001-02 2008-07-23 13:02:04,651 ConnectionFactory - Setting session state... (2 Replies)
Discussion started by: pcjandyala
2 Replies
Login or Register to Ask a Question