Link to home
Start Free TrialLog in
Avatar of galeboe
galeboe

asked on

C under Unix

I want to write a program that provides services to it users such that:
1. The user inputs a known servername and service e.g time, daytime, whois, etc.
2. The program then interrogates the named server and requests for the service required by the user.
3. The server's output is then displayed on the user's display in an easy to read format.
Avatar of ahoffmann
ahoffmann
Flag of Germany image

is
   csh -c "telnet rio.infodirekt.de 13 | & awk ' ( NR == 4 ) {print}'"
not sufficient?
Avatar of dotand
dotand

You didn;t write where is the problemastic part.
I think a simple two question program should work. First interogathe the user as to the machine name and later for the service name.
If you plan to offer only known in advance services that sit at specified ports you may simply encode the info as an array (associative or not is up to you).
Other-wise if the services are known services that sit at well known ports simply parse /etc/services for port number.

HTH,
Dotan
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial