In the example given below, I was expecting the line
$a=b
in the todel.txt file.
How do I add the here doc text block as it is without processing?
[root@localhost]# cat here_example.sh
#!/bin/sh
cat > todel.txt << heredoc
<?php
$a=b
# this is comment
?>
heredoc
[root@localhost]# cat todel.txt
<?php
=b
# this is comment
?>
Put quotes around “heredoc”: