Hello,
In the "Linux Bible" Tenth Edition page 100
I tried an example that I don't understand:
$ mail root < ~/.bashrc
Can someone please tell me!
Thanks ostene
Command line question
Re: Command line question
Command mail root runs program, mail, with one command-line parameter "root".
However, in this case we do not type the message. We redirect the content of a file into standard input of 'mail'. That is, we tell the bash to redirect (the <) the text in file "~/.bashrc" into the standard input of 'mail'.
In short, we send the content of file "~/.bashrc" as mail message to account "root".
Therefore, the command starts 'mail', tells it that TO-address of message will be "root", and starts to read the message text from standard input.man mail wrote:To send a message to one or more people, mailx can be invoked with arguments which are the names of people to whom the mail will be sent. The user is then expected to type in his message, followed by an `control-D' at the beginning of a line.
However, in this case we do not type the message. We redirect the content of a file into standard input of 'mail'. That is, we tell the bash to redirect (the <) the text in file "~/.bashrc" into the standard input of 'mail'.
In short, we send the content of file "~/.bashrc" as mail message to account "root".