I have a file with a list of hostnames. I want to read in the file and ssh to each hostname on the list. Do some commands, logout of the server and go onto the next on the list.
I am trying to find a site that is a good tutorial or examples so I can learn how to do more than just the basics with expect.
From reading this -- I don't see a reason to have to use expect.
You can execute commands on a remote system through ssh.
I'm sure you noticed I still entered a passwd. Ok so you setup your ssh keys between hosts so you don't have to enter a passwd.
So you parse your file to get your list of hostnames.
I have no idea the particulars of you situation -- So I am making stuff up.
This will execute date, uptime, and the df on all four hosts...
I use a script I made called forhost to do similar tasks. I work often on hundreds of machines in series, executing one -- or more commands on the host then moving on to the next host.
$1 is the command/commands you want to run and $2 is you list of boxes...
Here is how to use it:
Or....
Or.....
Hey guys, i am new in Shell programming and i would like to know some good links and websiites which has good tutorials and a wide range of examples on how the commands can be used. those which i have found just provide a brief coverage on the topic and mostly do not give proper examples of how the... (5 Replies)
Hello, I am starting ym first webpage and I am learning how to get images from a remote unix site to my unix account. But I don't know of any good sites to get some. Anyone know of any? (3 Replies)
Hello to all...this is my first post (so please go easy). :)
I feel pretty solid at expect scripting, but I'm running into an issue that I'm not able to wrap my head around. I wrote a script that is a little advanced for logging into a remote Linux machine and changing text in a file using sed.... (2 Replies)
Hi,
I am knew to Shell Scripting.
Can someone please tell me some good books for Shell Scripting which explains in a very simple language and covers all the topics nicely.
Thanks,
Shubh. (3 Replies)
HI All,
Does anyone out there know of any good online tutorials for the basics of routing, gateways, networking with AIX, preferably the more recent versions like 5.2/5.3?
Using commands such as netstat, smit mkroute, etc. to connect to boxes on a network, and load software with networked... (1 Reply)
i need to learn this very quick. i'm not trying delve deep into it. just enough to do basic things. does anyone know of any good sites to visit?? (1 Reply)
Just a quick request guys
As you might have guessed I've just started getting involved in Unix
The guys and the boss in the unix team (not with them yet) have given me some projects to do at my request.
Some of which involve scripting. The work is paying for me to go on a scripting... (2 Replies)
i'm not looking for anything that deals with "if-then" scripts.
i'd like something simple on how to run a series of processes. for example the following:
1. ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/tar_files/
2. lcd /
3. get pkgsrc.tar.gz
4. bye
5. cd /usr
6. rm -rf pkgsrc
7. cd... (3 Replies)