Forums Neueste Beiträge
 

I Need help in C Script in unix enviroment

09/04/2008 - 00:18 von QasimMalik.786 | Report spam
I want to Implement a Synchronisation primitive such as a semaphore
that will ensure mutual exclusion, prevent deadlock when concurrent
request are made from the clients. C scripts in the UNIX environment
in the below script

I ma just trying to stop two clients accessing the same server file at
the same time


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 <Enter>:"
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


Any help would greatly help

I am willing to do any thing in the return even pay
 

Lesen sie die antworten

#1 Juergen P. Meier
09/04/2008 - 06:10 | Warnen spam
:
Any help would greatly help



Helpful advise: Don't abuse csh for scripting.
http://www.faqs.org/faqs/unix-faq/s...sh-whynot/

Juergen
Juergen P. Meier - "This World is about to be Destroyed!"
end
If you think technology can solve your problems you don't understand
technology and you don't understand your problems. (Bruce Schneier)

Ähnliche fragen