In bash, it seems to me both here document and here string can be used for providing strings as stdin inputs. here document may provide an extra features to specify delimiter, which I am not sure if is necessary in any case.
What are the differences between their purposes? Can one always be used wherever the other is used? When shall we use which? Thanks.