s6-networking
Software
skarnet.org
The s6-getservbyname program
s6-getservbyname is a simple command-line interface to the getservbyname() function, converting a service name and protocol into a port number.
Interface
s6-getservbyname name proto
- s6-getservbyname looks up the network services database for an entry containing name name and protocol proto.
- It prints the corresponding port number to stdout, then exits 0.
- If it cannot find a related entry, it exits 1.
Example
On a standard machine with a correct /etc/services file and a non-garbled NSS configuration: s6-getservbyname smtp tcp prints 25.
