GTFOBins/GTFOBins.github.io

Suggest using here strings in bash

dubek opened this issue · 1 comments

dubek commented

Note that in bash (but not in Bourne shell) you can use <<< (here-string) to put a string in the standard input, instead of echo and pipe. So a file-write operation with tee would be:

./tee -a "$LFILE" <<< 'data'

instead of

echo data | ./tee -a "$LFILE"

This is not specific to tee, but relevant to all uses of echo in this repo. Not sure where is the correct place to mention this.

Yep, we know, the problem with <<< is (as you say) that is Bash only and we think that a more portable version may be better for those snippets.