04-16-2005
KORN Shell - Spawn new shell with commands
I want to be able to run a script on one server, that will spawn another shell which runs some commands on another server..
I have seen some code that may help - but I cant get it working as below:
spawn /usr/bin/ksh
send "telnet x <port_no>\r"
expect "Enter command: "
send "LOGIN:x:x; \r"
expect "Enter command:"
send "LOGOUT; \r"
close
but this errors - I may be missing code etc, I honestly dont know. Can anyone help me? Or is there another way to do this?
I dont want to execute a script on the other server, I want to log on to it and type some commands, get the response and log off... Please note I log on to server on a specific port - this is not telnet.
Any help would be appreciated.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
well i have this code here..and it works fine in kornshell..
#!/bin/ksh
home=c:/..../
input=$1
sed '1,3d' $input > $1.out
line=""
cat $1.out | while read a
do
line="$line $a"
done
echo $line > $1
rm $1.out
however...now i want it just in normal sh mode..how to convert this?... (21 Replies)
Discussion started by: forevercalz
21 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I have a script that uses "nohup" command to execute a korn shell script. Which one is the correct shell to use bourne shell or korn shell to execute a korn shell? and why?
Thanks in advanced. (2 Replies)
Discussion started by: XZOR
2 Replies
3. UNIX for Dummies Questions & Answers
I am doing this simple script using c shell and korn shell. The commands I use are fgrep , ls, and also some redirecting. Is there any difference in using both of these commands in c shell and korn shell? Thanks and sorry for the stupid question. (1 Reply)
Discussion started by: EquinoX
1 Replies
4. Shell Programming and Scripting
Hi,
I am new this forum. I request you peoples help in understanding and finding some solution to my problem.
Here it goes:
I need to perform this set of actions by writing a shell script. I need to read a config file for the bunch of processes to execute.
I need to fecth the pid of... (4 Replies)
Discussion started by: sachin4sachi
4 Replies
5. Shell Programming and Scripting
Hi All
I have writing a Korn Shell script to execute it on many of our servers. But some servers don't have Korn Shell installed, they use Borne Shell.
Some operations like calculation don't work :
cat ${file1} | tail -$((${num1}-${num2})) > ${file2}
Is it possible to activate Korn Shell... (3 Replies)
Discussion started by: madmat
3 Replies
6. Shell Programming and Scripting
Could some one tell me the difference btw Bourne shell and the Kshell? Which is more flexible and reliable in terms of portability and efficiency. When i type the following command ..
$ echo $SHELL
yields me
/bin/sh
Does this tells me that I am in Bourne shell. If yes, how can i get... (6 Replies)
Discussion started by: bobby1015
6 Replies
7. Shell Programming and Scripting
I am relatively new to shell scripting. I have a script I wrote that works fine in korn shell.
I need to make it work in bash on a different server.
There are a couple valid korn shell commands I am having difficulty finding the bash equivalents for.
At one point the scripts prompts the... (5 Replies)
Discussion started by: inakajin
5 Replies
8. Shell Programming and Scripting
Hi,
I have a problem with the spawn execution with expect.. i have done the code for expect in a separate file and i am calling the this execution from the bash script.. as given below..
-bash-4.1$ cat main.sh
#!/usr/bin/bash
./spawn.exp
==========================
-bash-4.1$ cat... (2 Replies)
Discussion started by: satishkumar432
2 Replies
9. Shell Programming and Scripting
Hi everyone,
I'm no killer in shell scripting, that is why I've searched and found a little script that explained how to do what I wanted to do : a FTP transfer from distant servers. I adapted it cause as such, it didn't work.
As I needed to do some very simple shell commands (erase and... (2 Replies)
Discussion started by: mederik
2 Replies
10. Programming
def gob(url):
print "\n\t Running gobuster on target."
params = " -e -s '307,200,204,301,302' -t 20 -u " + url + " >> /tmp/%s/gobuster.txt" % (ip)
os.system("xterm -e bash -c "tail -f /tmp/%/gobuster.txt"")
for i in bflist:
dirbf = "gobuster -w " + i... (3 Replies)
Discussion started by: alvinoo
3 Replies
LEARN ABOUT DEBIAN
keepalived
keepalived(8) System Manager's Manual keepalived(8)
NAME
keepalived. - keepalive demon
SYNOPSIS
/usr/sbin/keepalived [-n] [-f keepalived.conf] [-d] [-h] [-v]
DESCRIPTION
The keepalived The keepalived server implements the vrrpd routing demon which enables routing failover for a pair (or set) of routers (or
LVS directors) and the keepalived demon which sets up and does the health checking of virtual services in a Linux Virtual Servier.
OPTIONS
--vrrp, -P
Only run the VRRP subsystem.
--check, -C
Only run the healthchecker subsystem.
--dont-release-vrrp, -V
leave (don't remove) VRRP VIPs & VROUTEs on daemon stop.
--dont-release-ipvs, -I
Dont remove IPVS topology on daemon stop.
--dont-fork, -n
Dont fork the daemon process.
--use-file, -f keepalived.conf_file
Use the specified configuration file.
--wdog-vrrp, -R
Define VRRP watchdog polling delay (default=5s)
--wdog-check, -H
Define healthchecker's watchdog polling delay (default=5s)
--dump-conf, -d
Dump the configuration data.
--log-console, -l
Log messages to local console.
--log-detail, -D
Detailed log messages (the default with the rc script provided).
--log-facility, -S
0-7 Set syslog facility to LOG_LOCAL[0-7] (default=LOG_DAEMON)
--help, -h
Display a short inlined help screen.
--version, -v
Display the version number.
FILES
/etc/keepalived/keepalived.conf
SEE ALSO
keepalived.conf(5)
AUTHORS
Joseph Mack
from inspection of the output of keepalived --help from keepalived-1.1.4
Jan 2004 keepalived(8)