Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

12
  • 1
    And how to input binary values in this way? Without using the pipe (I know it can be done with the pipe as follows: echo -e "\x01\x02..." | ./script) Commented Dec 3, 2012 at 2:25
  • 1
    @jm666 sad thing is I learned yesterday if you use a bash alias, you just use the form command_alias <<< "stdin string", otherwise it will say command not found Commented Feb 12, 2014 at 17:26
  • 1
    @mekb takling about your examples / nothing. But imagine sed 's/x/y/' <<<'text'. Now the sed reading from its stdin the word text and outputs teyt. So, now here IS a difference. The exmple commands in the answer are just examples. You can replace the cat with any program reading from the STDIN. Commented Jul 8, 2021 at 11:43
  • 3
    A one-line 'here doc' is called a 'here string'. Commented Mar 5, 2023 at 21:48
  • 1
    Unless you want to calculate a hash or base64 off stdin :) Ask me how I found out about that extra character. Commented Jun 12, 2023 at 22:45