1: #!/bin/sh 2: echo "Example of unquoted here document, with variable and command substitution" 3: 4: cat <<EOF 5: This text will be fed to the "cat" program as 6: standard input. It will also have variable 7: and command substitutions performed. 8: I am logged in as $USER and today is `date` 9: EOF 10: 11: echo "Example of quoted here document, with no variable or command substitution" 12: cat <<"EndOfInput" 13: This text will be fed to the "cat" program as standard 14: input. Since the text string marking the end was quoted, it does not get 15: variable and command subsitutions. 16: I am logged in as $USER and today is `date` 17: The terminating string must be at the start of a line. 18: EndOfInput
| last modified 09/02/2006 | Introduction | Table of Contents (frame/no frame) |
Printable (single file) |
© Dartmouth College |