A variant of Here Documents the format is:
A here string uses a form of I/O redirection to feed a command to an interactive program or a command, such as ftp, cat, ex or read. This can be extremely handy. So basically those apps you run that allow user input can be automatically fed strings rather than you typing them!
I find Here Strings very useful to easily assign values to multiple variables.
For Example:
Now try:
and hopefully the value of the three variables will be displayed for you.
Make sure the variable is surrounded by double quotes!
bc <<<"2 + 2" 4
Note that, while bc(1) supports arbitrary precision, the default number of decimal points it displays is zero:
bc <<<"3 / 2" 1
To change this, set the "scale" variable to the number of decimal places you want to see:
bc <<<"scale = 3; 3 / 2" 1.500
3 pages link to HereStrings: