UNIX commands can send output anywhere when using output redirection, and they can also get input from places other than the keyboard. Figure 4-3 shows I/O locations in the case of stdin redirection.
We use the " less-than " symbol ( < ) for input redirection. Say that you have already created a text file with name myfile . You want to send this text file to a user jane through electronic mail. The easiest way to do this is to ask the mail program to get its input from this file instead of from the keyboard. The process of doing this is as follows .
$ mail jane <myfile $
The mail program sends an email message to user jane on the current system consisting of the contents of myfile . This is a more convenient way to type messages when you need time to compose them. You just create a file, and when you are satisfied with what you have typed, send it through email.
Top |