views:

160

answers:

2

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

+2  A: 

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
a
b
c
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.

Brian Agnew
A: 

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.

Martin Olsen