Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In VMS DCL one may embed data in a command file using $DECK and $EOD. What is Linux for this?

share|improve this question

migrated from stackoverflow.com Feb 12 '11 at 20:23

This question came from our site for professional and enthusiast programmers.

It may be worth explaining in a little more detail how $DECK/$EOL work – Brian Agnew Jun 14 '09 at 15:06
Would someone who has a VMS system add to the question an example that matches the "cat sample.txt << EOF" answer? – C.W.Holeman II Jun 14 '09 at 15:21
up vote 8 down vote accepted

You can embed data within shell scripts. How this works is shell dependent. However bash/perl etc. do this in similar ways, using a heredoc. e.g. in bash (and similar):

$ cat > sample.txt << EOF

will write as input a,b,c up to the EOF, and then cat will write that out to sample.txt. Note that EOF is a convention and you can use any label. Try the above on the command line to see more clearly what's going on.

share|improve this answer

Loki also made a tool called makeself. This tool can embed compressed data in a shell file and is useful for self-extracting installation scripts.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.