Sponsored Content
Top Forums Shell Programming and Scripting scripting problem (client / server files) HELP!!! Post 38779 by RTM on Friday 25th of July 2003 09:43:55 AM
Old 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

MSN client that allows scripting

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

Secure FTP Problem using Sun SSH on Client system F-Secure on Server system

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

Server - Client application problem

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

Client/Server Socket Application - Preventing Client from quitting on server crash

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

Sync files between unix client and windows 2003 server

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

Office server => laptop =>client server ...a lengthy and laborious ftp procedure

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

please help a problem in client-server ipc message 2 pipes communication simple example

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

kill() function problem in client-server ipc message using 2 FIFOs

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

Sftp script for dev server to client server

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

Shell scripting to transfer files from one to another server through ftps

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
echo(1B)					     SunOS/BSD Compatibility Package Commands						  echo(1B)

NAME
echo - echo arguments to standard output SYNOPSIS
/usr/ucb/echo [-n] [argument] DESCRIPTION
echo writes its arguments, separated by BLANKs and terminated by a NEWLINE, to the standard output. echo is useful for producing diagnostics in command files and for sending known data into a pipe, and for displaying the contents of envi- ronment variables. For example, you can use echo to determine how many subdirectories below the root directory (/) is your current directory, as follows: o echo your current-working-directory's full pathname o pipe the output through tr to translate the path's embedded slash-characters into space-characters o pipe that output through wc -w for a count of the names in your path. example% /usr/bin/echo "echo $PWD | tr '/' ' ' | wc -w" See tr(1) and wc(1) for their functionality. The shells csh(1), ksh(1), and sh(1), each have an echo built-in command, which, by default, will have precedence, and will be invoked if the user calls echo without a full pathname. /usr/ucb/echo and csh's echo() have an -n option, but do not understand back-slashed escape characters. sh's echo(), ksh's echo(), and /usr/bin/echo, on the other hand, understand the black-slashed escape characters, and ksh's echo() also understands a as the audible bell character; however, these commands do not have an -n option. OPTIONS
-n Do not add the NEWLINE to the output. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscpu | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), echo(1), ksh(1), sh(1), tr(1), wc(1), attributes(5) NOTES
The -n option is a transition aid for BSD applications, and may not be supported in future releases. SunOS 5.11 3 Aug 1994 echo(1B)
All times are GMT -4. The time now is 03:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy