Running shell scripts on a remote server


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Running shell scripts on a remote server
# 1  
Old 07-22-2003
Running shell scripts on a remote server

Hi -
I am running Mac OS X (Terminal) at my current workstation, and I would like to telnet to my local server to run a shell script. The local server is a Solaris machine (don't know the version or the type of Unix being run on it, sorry.)

The problem I have is that when I create a #!/bin/sh line, the local server doesn't recognize it . I run less on the .sh script file, so that I can see its contents and I only see the last three lines of the script.

Any suggestions for what I might be doing wrong? By the way, if it helps, the shell script file I created was made on the Mac, using BBEdit, but was saved as a Unix specific, Unix line breaks file. So, I should not be getting any "^M" character set issues with carriage returns.

Thanks for any suggestions you may have!
# 2  
Old 07-22-2003
A possible solution is to Telnet to the server where you wish to create the script, and use VI to create it on the server it's self.
# 3  
Old 07-22-2003
Certainly that's a possibility. However, my script is designed to go to that server and retrieve a bunch of files. Each time I run the script, I would be retrieving different files. Its easier to somehow batch these retrievals rather than have to edit the script in VI each time I want to run it. I would like to use Perl, ideally, but I just don't understand it well enough.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sudo connect to a remote server and execute scripts in remote server

Hello Every one!! I am trying to write a shell script which will connect to a remote server and execute scripts which are at a certain path in the remote server. Before this I am using a sudo command to change the user. The place where I am stuck is, I am able to connect to the... (6 Replies)
Discussion started by: masubram
6 Replies

2. Shell Programming and Scripting

How to Append the output of a script running in remote server to a file in local server?

Hi guys, So i am in server1 and i have to login to server 2, 3,4 and run some script there(logging script) and output its result. What i am doing is running the script in server2 and outputting it to a file in server 2 and then Scp'ing the file to server1. Similarly i am doing this for other... (5 Replies)
Discussion started by: srkmish
5 Replies

3. Shell Programming and Scripting

Run scripts on remote server

I have a sql script in my parent server - host1 i can do a passwordless ssh to remote server - host1a and host1b Can i run the sql script which is present in host1 by connecting to host1a and host1b. Should i place the sql script in host1a and host1b ? Is there a way i can run without placing... (2 Replies)
Discussion started by: Nagesh_1985
2 Replies

4. Shell Programming and Scripting

Running script on remote server

Hi All, I need to run a ksh script on around 200 servers(consisting of AIX,LInux,HP-UX,Solaris). The script is there in the /tmp directory of all the servers. I want want to execute the script in background on the respective servers and then exit from there. I have written something like below:... (8 Replies)
Discussion started by: proactiveaditya
8 Replies

5. UNIX for Dummies Questions & Answers

Running scripts from different server

Hi, I need a script (ksh) on ServerAdmin that will run an archive scripts from different several Servers through ssh. The problem is that how can i switch user when before running the archive script. I already configured password-less connection on the servers. server 1... (1 Reply)
Discussion started by: chococrunch6
1 Replies

6. Shell Programming and Scripting

Running for loop on remote server

Hi, I'm having a problem performing for loop on remote server, i know this can be done with one liner but i'm not sure how it works if using logical operator such as for ifs and case or while for server in sterverA serverB serverC ; do ssh -v $server "cd ~/MyDocuments/; bag=`find... (6 Replies)
Discussion started by: sexyTrojan
6 Replies

7. Shell Programming and Scripting

Execute scripts on remote server

Hi All, I need to first of all establish a connection to remote unix server non-interactively with the help of a shell script and then connect to oracle database from that server all with this script of mine. Please suggest the best method which could be used to connect to server for executing... (1 Reply)
Discussion started by: m_kapur83
1 Replies

8. 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

9. Solaris

Running command on Remote server

Hi, I have username/password for a remote server. I would like to have list of filenames and their size in a particular directory of remote server. Now Problem is - I can not use rsh command as I can not modify rhost file of remote server. Thanks in advance. Sanjay (1 Reply)
Discussion started by: sanjay1979
1 Replies

10. Shell Programming and Scripting

running a script on remote server.

I need to run a script on a remote server from my ksh script. The issue I'm having is that I need to logon to the remote server as a different user. (see the following) logged on to server 1 as adsmgr neet to log on to server 2 as odemgr run passwd_util.ksh Thanks in advance. (1 Reply)
Discussion started by: whited05
1 Replies
Login or Register to Ask a Question