07-25-2003
See number six -
Quote:
Client Script
--------------
echo " select any option to execute:"
echo " c or C: To connect Client to Server"
echo " r or R: To make a read request"
echo " s or S: I want to sort data"
echo " g or G: Look for a certain word in a file"
echo " e or E: quit"
echo -n "Enter your option and press :"
set selection = `head -1`
switch ("$selection")
case [cC]:
echo -n "enter server name"
set servername = `head -1`
find $servername
breaksw
case [rR]:
cp
echo -n "enter server file to read content"
set serverfile = `head -1`
breaksw
case [sS]:
sort
echo -n "enter server file to sort"
set serverfile1 = `head -1`
breaksw
case [qQ]:
exit 0
breaksw
default:
case [qQ]:
exit 0
breaksw
default:
echo " wrong option."
exit 1
breaksw
endsw
exit 0
--
Server script
--------------
if (($servername[1] == option1)) then
set servername =``
echo "main server is connected" >> ./monitor/serverlock
echo "main server is connected"
endif
if ($argv[1] == 'option4') then
echo -n "enter file to search:"
set datafile = `head -1`
echo -n "enter word or data to search:"
set data = `head -1`
echo ""
echo -n $data
echo -n $datafile
grep -i $data $datafile
echo ""
echo ""
endif
if (($argv[1] == option2)) then
echo -n "enter file to read:"
set datafile = `head -1`
if (($datafile == course)) then
cat course && cat course> ServerMaster1
echo "read the course file" >> ./monitor/courselock
else if (($datafile == student)) then
cat student && cat student > ServerMaster2
echo "read the student file" >> ./monitor/studentlock
else if (($datafile == exam)) then
cat exam && cat exam > ServerMaster3
echo "read the exam file" >> ./monitor/examlock
endif
endif
if ($argv[1] == 'option3') then
echo -n "enter file to sort:"
set datafile = `head -1`
if (-e $datafile) then
sort $datafile
echo -n "server sorted"
end if
endif
I also have .csh files named student, exam and course 25 records in each.
Have you asked for help from your instructor?
10 More Discussions You Might Find Interesting
1. Linux
Would any of you know if there are any Linux (and/or BSD) MSN-clients that make it possible to send messages from shellscripts? When I search sourceforge I get lots of hits, but none of these really advertise this ability.
I would like to have my servers send me a message when certain events... (0 Replies)
Discussion started by: indo1144
0 Replies
2. Solaris
I am using shell script to do secure ftp. I have done key file setup to do password less authentication. Following are the FTP Details:
FTP Client has Sun SSH.
FTP Server has F-Secure.
I am using SCP Command to do secure copy files. When I am doing this, I am getting the foll error
scp:... (2 Replies)
Discussion started by: ftpguy
2 Replies
3. Programming
hi all
I'm beginner in CORBA Server-Client appliction development.
My server- client application was worked well and i have tested it too.
Due to some Network problem we have rebooted our dedicated server , then i restart my corba service, application in the server it started... (0 Replies)
Discussion started by: VijayakumarN
0 Replies
4. Programming
Problem
- Linux Client/Server Socket Application: Preventing Client from quitting on server crash
Hi,
I am writing a Linux socket Server and Client using TCP protocol on Ubuntu 9.04 x64.
I am having problem trying to implement a scenario where the client should keep running even when the... (2 Replies)
Discussion started by: varun.nagpaal
2 Replies
5. UNIX for Dummies Questions & Answers
Hi everybody...
I want to sync files between unix client machine and windows 2003 server machine.
I thought of using Cygwin for windows server and then rsync between two to sync files, but have come to know that might be Cygwin will not be able to handle multiple clients request....
Can any... (2 Replies)
Discussion started by: lokeshsingla
2 Replies
6. Windows & DOS: Issues & Discussions
Hi All,
I need your expertise in finding a way to solve my problem.Please excuse if this is not the right forum to ask this question and guide me to the correct forum,if possible.
I am a DBA and on a daily basis i have to ftp huge dump files from my company server to my laptop and then... (3 Replies)
Discussion started by: kunwar
3 Replies
7. Programming
I want to have a message send & receive through 2 half-duplex pipes
Flow of data
top half pipe
stdin--->parent(client) fd1--->pipe1-->child(server) fd1
bottom half pipe
child(server) fd2---->pipe2--->parent(client) fd2--->stdout
I need to have boundary structed message... (1 Reply)
Discussion started by: ouou
1 Replies
8. Programming
I want to have a message send & receive through 2 uni-direction FIFO
Flow of data
FIFO1
stdin--->parent(client) writefd--->FIFO1-->child(server) readfd
FIFO2
child(server) writefd2---->FIFO2--->parent(client) readfd2--->stdout
I need to have boundary structed message... (3 Replies)
Discussion started by: ouou
3 Replies
9. Shell Programming and Scripting
hi, i am new to unix,
cuold u send some sftp acripts to send files to dev server to clint server, (1 Reply)
Discussion started by: Koti.annam
1 Replies
10. Shell Programming and Scripting
Hi Guyz ,,
I'm an ERP functional guy , I really need to automate a script which required a shell script but have a little knowledge in shell scripting.
I need my generated files to be zipped first in one directory lets say (xyz) and then it needs to transfer another ftp server in... (3 Replies)
Discussion started by: Shogundion
3 Replies
LEARN ABOUT DEBIAN
net::smtp::server::relay
Server::Relay(3pm) User Contributed Perl Documentation Server::Relay(3pm)
NAME
Net::SMTP::Server::Relay - A simple relay module for Net::SMTP::Server.
SYNOPSIS
use Carp;
use Net::SMTP::Server;
use Net::SMTP::Server::Client;
use Net::SMTP::Server::Relay;
$server = new Net::SMTP::Server('localhost', 25) ||
croak("Unable to handle client connection: $!
");
while($conn = $server->accept()) {
# We can perform all sorts of checks here for spammers, ACLs,
# and other useful stuff to check on a connection.
# Handle the client's connection and spawn off a new parser.
# This can/should be a fork() or a new thread,
# but for simplicity...
my $client = new Net::SMTP::Server::Client($conn) ||
croak("Unable to handle client connection: $!
");
# Process the client. This command will block until
# the connecting client completes the SMTP transaction.
$client->process || next;
# In this simple server, we're just relaying everything
# to a server. If a real server were implemented, you
# could save email to a file, or perform various other
# actions on it here.
my $relay = new Net::SMTP::Server::Relay($client->{FROM},
$client->{TO},
$client->{MSG});
}
DESCRIPTION
The Net::SMTP::Server::Relay module implements simple SMTP relaying for use with the Net::SMTP::Server module. All this module does is to
take a given message and iterate through the list of recipients, doing DNS lookups for the associated MX record and delivering the
messages. This module makes extensive use of the plethora of other modules already implemented for Perl (specifically the DNS and
Net::SMTP modules in this case), and should give but a glimpse of the potential for extending the Net::SMTP::Server's functionality to
provide a full-featured SMTP server, native to Perl.
The above example illustrates the use of the Net::SMTP::Server::Relay modules -- you simply have to instantiate the module, passing along
the sender, recipients, and message. More formally:
$relay = new Net::SMTP::Server::Relay($from, @to, $msg);
Where $from is the sender, @to is an array containing the list of recipients, and $msg is the message to relay.
AUTHOR AND COPYRIGHT Net::SMTP::Server / SMTP::Server is Copyright(C) 1999, MacGyver (aka Habeeb J. Dihu) <macgyver@tos.net>. ALL RIGHTS
RESERVED.
You may distribute this package under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl
README file.
SEE ALSO
Net::SMTP::Server::Server, Net::SMTP::Server::Client
perl v5.10.1 1999-12-28 Server::Relay(3pm)