Script to connect to remote and sendmail.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to connect to remote and sendmail.
# 8  
Old 02-22-2018
Does /xyz/INVESTIG/Sadiq/ exist on the remote node?
Is PushFileToMail_IP() executed? Correctly? You redirected its stderr to /dev/null.

@Don Cragun: I don't see a problem with the BODY variable assignment continued in the next line.

Last edited by RudiC; 02-22-2018 at 04:06 AM..
This User Gave Thanks to RudiC For This Post:
# 9  
Old 02-22-2018
Thanks Cragun, files was existing at remote place, I have removed the PushFileToMail_IP() as inside ssh i can access the local files.
Fixed the issue.

Now i am able to get the required output.

Code:
Dear Team,

Kindly find the below host and their port which are unable to connect.

Connection refused to abc@1.2.3.42 on port 2244

Connection refused to abc@1.2.3.43 on port 2244

Please verified and take a necessary action with concerned team.

Regards,
Sadique


Last edited by RudiC; 02-22-2018 at 04:44 AM..
# 10  
Old 02-22-2018
I didn't look closely enough at the code that vgersh99 suggested in post #5. The command substitutions are inside single quotes inside double quotes. Inside double quotes, the single quotes are just regular characters, so there is no reason that the command substitution should not work as long as the file that is the operand to cat is on the local machine; not on the remote machine.

What wasn't clear from your code (and may be what the problem is in vgersh99's code) is whether the file /xyz/INVESTIG/Sadiq is supposed to be found on the machine on which you are running your script or on the machine to which you are sshing.

I apologize for any confusion I caused in post #6.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

2. HP-UX

Connect to remote server using sftp with password define within command/script

I am trying to connect to remote server in hp-ux, using sftp command (using sftp username@ip and password ) able to connect to remote server but, in this case sftp prompt for password and user need to manually enter it. I want sftp can read a password define in script or from file, so it can... (1 Reply)
Discussion started by: ketanraut
1 Replies

3. Shell Programming and Scripting

Bash script connect to remote servers and become root

Hi, I need a script that will connect to a list of servers and first sudo to root and then run a couple of commands. For security reasons, we can't setup ssh keys as root. Manually I have to login to a server as user and then sudo to root. It's not possible to use root@servername , because of... (8 Replies)
Discussion started by: misterx12345
8 Replies

4. AIX

AIX Remote Connect Fail With “No more multiple IP addresses to connect” Error

We have a production server at a client site running AIX. And recently when users are trying to connect to it via telnet, it prompts "No more multiple IP addresses to connect". Can I know what does this error mean? and how to rectify this? Thanks. (2 Replies)
Discussion started by: a_sim
2 Replies

5. Shell Programming and Scripting

Script to connect to a remote server and execute scripts

Hello All I need a script or set of commands which can establish a remote connection with another server and execute some scripts over there. Basically it has to establish the connection with the remote server as an user ,say 'testuser' and then execute the script 'testscript'. and return the... (5 Replies)
Discussion started by: sgbhat
5 Replies

6. Shell Programming and Scripting

shell script for how to connect to a remote server by using ssh

i want to connect to a remote server through ssh. i have to also provide password within that script. after connecting to the remote server i want to do some operations like grep,cd etc can u pls help me to wite a script. Thanks (1 Reply)
Discussion started by: millan
1 Replies

7. Shell Programming and Scripting

How can my unix shell script automatically connect to remote host?

How can my unix shell script automatically connect to remote host? Assume that there is a remote host called "rhost". When I connect to that host i give the command "telnet rhost". It then asks me for my id and password. Once i give it connects there. I want to automate these steps. I want... (8 Replies)
Discussion started by: digdarshan
8 Replies

8. Shell Programming and Scripting

Connect to a Remote Sybase Server Through Script

Hi all, I am trying to connect to Remote Sybase database Server through shell script. I am operating on WindowsXP, connect to Unix(version SunOS: 5.8) The thing is i dont know how to connect to Sybase Server through my script file? Are there any manual pages which can guide me through the... (3 Replies)
Discussion started by: Aparna_k82
3 Replies

9. Windows & DOS: Issues & Discussions

Connect to a Remote Sybase Server Through Script.

Hi all, I am trying to connect to Remote Sybase database Server through shell script. I am operating on WindowsXP, connect to Unix(version SunOS: 5.8) The thing is i dont know how to connect to Sybase Server through my script file? Are there any manual pages which can guide me through the... (2 Replies)
Discussion started by: Aparna_k82
2 Replies

10. UNIX for Advanced & Expert Users

sendmail : connect local host (brocken)

hi there I've got a strange problem with a webserver box (suse linux 7.2). My MTA is sendmail, and when I tried manually send a mail. Sendmail -v "user@something" < /etc/hosts The Server tried "simon@localhost... Connecting to local..." but nothing happend and the system hold on. This... (3 Replies)
Discussion started by: mrsaint
3 Replies
Login or Register to Ask a Question