Use correct syntax markup for shell
Approved by: carlavilla
This commit is contained in:
parent
55c95407aa
commit
a9a9e66105
666 changed files with 17924 additions and 17924 deletions
|
|
@ -449,7 +449,7 @@ int main() {
|
|||
|
||||
Go ahead, enter it in your editor, save it as [.filename]#daytime.c#, then compile and run it:
|
||||
|
||||
[source,bash]
|
||||
[source,shell]
|
||||
....
|
||||
% cc -O3 -o daytime daytime.c
|
||||
% ./daytime
|
||||
|
|
@ -662,7 +662,7 @@ Not all protocols are that simple. Many receive a request from the client, reply
|
|||
|
||||
Now, go ahead, save the above source code as [.filename]#daytimed.c# (it is customary to end the names of daemons with the letter `d`). After you have compiled it, try running it:
|
||||
|
||||
[source,bash]
|
||||
[source,shell]
|
||||
....
|
||||
% ./daytimed
|
||||
bind: Permission denied
|
||||
|
|
@ -673,7 +673,7 @@ What happened here? As you will recall, the _daytime_ protocol uses port 13. But
|
|||
|
||||
Try again, this time as the superuser:
|
||||
|
||||
[source,bash]
|
||||
[source,shell]
|
||||
....
|
||||
# ./daytimed
|
||||
#
|
||||
|
|
@ -681,7 +681,7 @@ Try again, this time as the superuser:
|
|||
|
||||
What... Nothing? Let us try again:
|
||||
|
||||
[source,bash]
|
||||
[source,shell]
|
||||
....
|
||||
# ./daytimed
|
||||
|
||||
|
|
@ -693,7 +693,7 @@ Every port can only be bound by one program at a time. Our first attempt was ind
|
|||
|
||||
Fine, we know it is running in the background. But is it working? How do we know it is a proper _daytime_ server? Simple:
|
||||
|
||||
[source,bash]
|
||||
[source,shell]
|
||||
....
|
||||
% telnet localhost 13
|
||||
|
||||
|
|
@ -711,7 +711,7 @@ telnet tried the new IPv6, and failed. It retried with IPv4 and succeeded. The d
|
|||
|
||||
If you have access to another UNIX(R) system via telnet, you can use it to test accessing the server remotely. My computer does not have a static IP address, so this is what I did:
|
||||
|
||||
[source,bash]
|
||||
[source,shell]
|
||||
....
|
||||
% who
|
||||
|
||||
|
|
@ -729,7 +729,7 @@ Connection closed by foreign host.
|
|||
|
||||
Again, it worked. Will it work using the domain name?
|
||||
|
||||
[source,bash]
|
||||
[source,shell]
|
||||
....
|
||||
% telnet r47.bfm.org 13
|
||||
|
||||
|
|
@ -822,7 +822,7 @@ We now can type a domain name (or an IP address, it works both ways) on the comm
|
|||
|
||||
Since it takes virtually no time to get the time from your local server, you could run daytime twice in a row: First to get the time from `time.nist.gov`, the second time from your own system. You can then compare the results and see how exact your system clock is:
|
||||
|
||||
[source,bash]
|
||||
[source,shell]
|
||||
....
|
||||
% daytime ; daytime localhost
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue