I hadn't heard about using quotes before but that managed to get me sorted.The quotes that you put around the end-of-file tag apply to the whole heredoc. So assuming you want the have $PATH literally in the output:Code:[f12.185] $ cat - <<'EOF' > $PATH > EOF $PATH
# pkg stuff
#
# /etc/pkg/FreeBSD.conf
#
cat <<EOF >/mnt/install/etc/rc.d/firstboot
sed -n 6,7p /etc/pkg/FreeBSD.conf | sed 's/^# *//' | sh
EOF
chmod a+x /mnt/install/etc/rc.d/firstboot
touch /mnt/install/firstboot
cat <<'EOF' >>/mnt/install/etc/rc.d/firstboot
cat <<EOF2 >/usr/local/etc/pkg/repos/local-repo.conf
local-repo: {
url: "file:///mnt/pkg-repo/\${ABI}/quarterly",
signature_type: "none",
enabled: yes
}
EOF2
EOF
The quotes that you put around the end-of-file tag apply to the whole heredoc. So assuming you want the have $PATH literally in the output:Code:[f12.185] $ cat - <<'EOF' > $PATH > EOF $PATH