Iamlaosong
We often use the <<eof redirect input in the shell script to input the command string we entered as an execution program, so that we do not need to manually enter the command in that program environment in order to automate the functions we need, such as:
Sqlplus EMSSXJK/EMSSXJK <<eofselect Count (*) from Sncn_yxyj where create_date like sysdate; Eof
The SQL statement is equivalent to the input in the Sqlplus program environment, so that the input content is sandwiched between two eof, can be long and short, EOF can also be replaced by any other character, case, as long as the pair appears, for example:
Sqlplus EMSSXJK/EMSSXJK <<stdselect Count (*) from Sncn_yxyj where create_date like sysdate; STD
Of course thisiconicCharacters cannot be reserved words, most commonly used or EOF.
Note that the first EOF must start with the redirect character <<, and the second EOF must be shelf written, otherwise it will be an error.
Let's look at an example of automatic ftp:
#ftp data to 10.178.37.244rq= ' date +%y%m%d ' cd/data/product/songftp-i-n <<!open 10.178.37.244 user Oracle Post CD EMS Binput ${rq}.dat bye!
Instructions for redirecting <<eof in the shell