quick newb question
I know that >> appends to the bottom of a file...
but what does << do? I've searched google, and found that google ignores special characters, and there're no entries in the man file or help files, that i could find... |
It sends the file on the right of the << as the input for the command.
HTH Forrest |
Quote:
|
There are three standard file handles that you need to know about
stdin 0 stdout 1 stderr 2 Commands take input from stdin, send normal output to stdout and send error messages to stderr < file sends the contents of file into stdin to be used by command xyz << file reads lines of input from the keyboard, until the message "file" is given. > file or 1> file redirects the normal output to file (replacing the previous content if the file exists) >> file or 1>> file redirects normal output to file (appending to the end of the file) 2> file redirects the error messages to file (replacing the previous content if the file exists) 2>> file redirects the error messages to file (appending to the end of the file) 2>&1 redirects the error messages to the address for stdout |
Quote:
Code:
cat << EOF |
The example from Disillusionist is a so-called "here document". If you want to fed a command with a simple string you can use a "here string" using the triple input redirection:
Code:
grep example <<< "A simple example" |
All times are GMT -5. The time now is 01:32 AM. |