I'm writing a bash shell script whose purpose is to create a php skeleton for new projects.
To create certain php documents within the newly created directory structure, I'm using HEREDOCs with tons of codelines..
sudo tee $projectname/www/index.php <<- EOF | > null
<?php
ob_start();
require_once 'inc/header.inc';
ob_end_flush();
?>
EOF
## Create header.inc
sudo tee $projectname/www/inc/header.inc <<- EOF 1>&2
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
....
EOF
The problem is:
All HEREDOC lines are echoed to the screen. That is really not what I want, it looks very messy.
So, I tried to issue this, by redirecting output to null
and /dev/null
. Unfortunately without success.
Research: