Skip to main content

Here Strings: Quick Input

Here strings are short here documents. One line. Quick.

Here's the thing: Here strings are quick. Use them for simple input.

Basic Syntax

command <<< "input"

My take: <<< is here string. Quick input.

Common Use

grep "pattern" <<< "text to search"

My take: Here strings are quick. Use them.

Common Patterns

Quick Input

tr 'a-z' 'A-Z' <<< "hello"

What's Next?

Now that you understand here strings, let's talk about Pipes.


Personal note: Here strings seemed unnecessary at first. Then I used them. Now I use them for quick input. They're useful. Learn them.