Title: Input Redirection (<)
Course: CIS 121: Linux/UNIX I: Fundamentals ~ For IGNITE Review > Section: Learning Modules

< stdin

Redirecting stdin is done with '<' (short for 0<).

[paul@RHEL4b ~]$ cat < text.txt
one
two

[paul@RHEL4b ~]$ tr 'onetw' 'ONEZZ' < text.txt
ONE
ZZO

<< here document

The here document (sometimes called here-is-document) is a way to append input until a certain sequence (usually EOF) is encountered. The EOF marker can be typed literally or can be called with Ctrl-D.

[paul@RHEL4b ~]$ cat <<EOF > text.txt
> one
> two
> EOF

[paul@RHEL4b ~]$ cat text.txt
one
two

[paul@RHEL4b ~]$ cat <<brol > text.txt
> brel
> brol

[paul@RHEL4b ~]$ cat text.txt
brel

(Cobbaut, p. 118)