Common heredoc delimiters in Linux shell scripting can be any string, but there are a few conventions that are frequently used. The most common delimiters include:
-
EOF: This is the most widely used delimiter. It stands for "End Of File."
command <<EOF content EOF -
END: Another popular choice, similar to EOF.
command <<END content END -
HEREDOC: This is also used, especially when the purpose of the heredoc is to be more descriptive.
command <<HEREDOC content HEREDOC -
CUSTOM_STRING: You can use any string as a delimiter, as long as it is consistent at both the start and end of the heredoc.
command <<CUSTOM_STRING content CUSTOM_STRING
The choice of delimiter is flexible, but it's important to ensure that the chosen delimiter does not appear in the content of the heredoc itself. This prevents confusion and ensures proper termination of the heredoc.
