07-16-2013
Automate an application using scripting, managing multiple terminals
Hi
I am new to Ubuntu and Bash scripting. I am working on a project to give a demo on an SDN application to my class. I need some help in scripting to create the demo. Please help in case if you have any idea on what am asking.
The demo uses a tool called mininet. I need just one script so that I can automate the whole of my demo.
The commands I need to run are given in order below.
1. Run "sudo mn" on the terminal. This changes the prompt from
/mininet$ sudo mn
to
mininet>
2. Now on this terminal where the prompt is 'mininet>' , I need to run "xterm h1" followed by "xterm h2" to create separate terminals for two hosts created by mininet.
3. I have to access the xterm terminal for h1 and run a command there . eg: ifconfig
4. I have to access the xterm terminal for h2 and run a command there . eg : set ip address
5. I have to run a ping in xterm terminal for h1 and while this is happening, i want to access terminals of h2 and start a ping in xterm terminals of h2.
6. I have to go back to the previous terminal from where the xterm terminals were spawned. 'mininet>' prompt one. and run "exit" and then when the promp goes back to normal '/mininet$' i have to "sudo mn -c" .
All of this should be done from one script. Please ignore the specific command mentioned and give a generic solution or clues.
9 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Dear Members,
I have aquired a load of old Wyse dumb terminals. I have a Linux system set up that I want to be the host for all of these. Now, I know these don't use cat5 or standard networking. They are all done through serial (com) ports. However, I researched this more and found a converter... (25 Replies)
Discussion started by: Phobos
25 Replies
2. Shell Programming and Scripting
I'd like to write a script that will call n number of terminals that will all ssh to X-server and automatically enter the same password.
Unfortunately I'm not exactly sure what kind of commands would work for me here because when I call for gnome-terminal, a new terminal pops up and the old... (1 Reply)
Discussion started by: gelitini
1 Replies
3. Shell Programming and Scripting
I want to launch some shell scripts.
I would have the possibility to change the number of shell scripts launched dynamically by modifying a variable, or a configuration file.
For example, I start to launch 4 scripts at the same time, and after that, by modifying a variable, 6 scripts are... (0 Replies)
Discussion started by: gonzo38
0 Replies
4. OS X (Apple)
Hello,
I am new to the mac world, and would like to automate my login to cisco devices (routers, switches etc...), i am in a need of writing a script that i may just click on an icon on the desktop and it will open terminal and run a few command.
as follow:
telnet to an ip address
type... (2 Replies)
Discussion started by: drdread
2 Replies
5. Shell Programming and Scripting
Hi, I'm looking for a way to send commands through multiple shells/terminals (not sure which is proper syntax). Basically, I have to open 3 different shells/terminals and run separate parts of a program suite in each of them. I find this annoying. The commands I have to do are simple, and could... (1 Reply)
Discussion started by: Caradoc
1 Replies
6. Programming
Hi,
Basically I've written a game in ncurses that supports multiple players. Each player has a process associated with him which shares a segment of memory in which the player's structures are stored, and these structured are accessed by the 'server' program and handled there. The scope of the... (13 Replies)
Discussion started by: dgre0018
13 Replies
7. AIX
I just wondering if there are ways to open multiple virtual terminal to a single LPAR.
After I have use putty to login to the VIOS. I will use mkvt -id <LPAR id> to open console but if my friend want to open 2 second one, it will say, VT already connected.
IS there a way to work this around ? ... (1 Reply)
Discussion started by: wingcross
1 Replies
8. Shell Programming and Scripting
Background:
I am writing a script to help me automate tweaks and things I apply to a custom Android rom I developed. I am on the very last part of my script, and I am stuck trying to find the right command to do what I seek.
When I build roms from source, a file called updater-script is... (8 Replies)
Discussion started by: Silverlink34
8 Replies
9. Shell Programming and Scripting
Hi,
I am trying to count the number of times a string of letters occurs in a file for multiple unique strings of letters. Right now I can do this one at a time using the following code (in this example I am searching for the string "AAA"):
echo AAA >> outfile.txt
grep -c "AAA" -r... (4 Replies)
Discussion started by: gecko1
4 Replies
LEARN ABOUT DEBIAN
xtitle
XTITLE(1) General Commands Manual XTITLE(1)
NAME
xtitle - set window title and icon name for an X11 terminal window
SYNOPSIS
xtitle [ -tiq ] [ -- ] string ... | [ -V ] [ -h ]
DESCRIPTION
Xtitle will set the window title and/or the icon name of the terminal window in which it is run to be its command line arguments. It does
this by outputting the appropriate xterm(1) control sequence characters. Unless suppressed, xtitle will also report the settings it has
made.
OPTIONS
-- Interprets all following arguments as strings instead of options.
-h, --help
Prints a helpful usage message.
-i, --icon
Only set the icon name. Default sets both.
-t, --title
Only set the window title. Default sets both.
-v, --verbose
Quiet mode. Doesn't report the settings performed.
-V, --version
Only prints the program version.
CAVEATS
Xtitle is known to work with xterm(1) and dtterm(1). The effect of the control sequences in other terminals is not known, though I
wouldn't expect any problems.
VERSION
1.0.2
AUTHOR
Steve Kinzler, kinzler@cs.indiana.edu, Nov 1993/Nov 1998/Mar 2000/Dec 2009
URL
http://www.cs.indiana.edu/~kinzler/xtitle/
SEE ALSO
xterm(1), dtterm(1)
1.0.2 XTITLE(1)