While browsing SO I sometimes see EOFD for example:
ftp -vn <$hostname> <<EOFD
Yes I tried Google with no luck, just in case you are wondering.
In the context of the question you reference, EOFD
doesn't mean anything special, it's just the start of a bash here document.
From the Advanced Bash-Scripting Guide:
A here document is a special-purpose code block. It uses a form of I/O redirection to feed a command list to an interactive program or a command, such as ftp, cat, or the ex text editor.
COMMAND <<InputComesFromHERE ... ... ... InputComesFromHERE
A limit string delineates (frames) the command list. The special symbol
<<
precedes the limit string. This has the effect of redirecting the output of a command block into thestdin
of the program or command. It is similar tointeractive-program < command-file
, wherecommand-file
containscommand #1 command #2 ...
The
here document
equivalent looks like this:interactive-program <<LimitString command #1 command #2 ... LimitString
Choose a
limit string
sufficiently unusual that it will not occur anywhere in the command list and confuse matters.
So in that question, the author was sending commands to ftp
as if using it interactively.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With