1

I get the following code to get a fingerprint from private key of OpenSSH.

$ key=`ssh-keygen -yf ~/.ssh/id_rsa`; ssh-keygen -lf /dev/stdin <<<$key

However, I do not know <<< $key syntax. What behavior is this? Is there a web site that explains this syntax?

higr
  • 23
  • 2
  • 3
    That's a [Here String](http://www.gnu.org/software/bash/manual/bashref.html#Here-Strings). – Etan Reisner Jul 15 '15 at 19:55
  • 2
    @TrisNefzger, no, `<"$key"` is reading from a file named by the expansion of `"$key"`, which is a different operation. – Charles Duffy Jul 15 '15 at 19:56
  • There is a site called google. If you type "bash triple less than" it can take you to many magical places that tells you what it does... – ODelibalta Jul 15 '15 at 19:56
  • 1
    It's not reasonable to have a "what is X?" question for every single language feature X. For that reason, I'm skeptical that questions of this form are worthwhile contributions to the knowledge base. – Charles Duffy Jul 15 '15 at 19:56
  • Open `man bash` and then search on `<<<`. – John1024 Jul 15 '15 at 19:56
  • @TrisNefzger, ...a man page already linked to at a more authoritative location by Etan, and quoted directly in an answer by Mike. – Charles Duffy Jul 15 '15 at 20:03
  • Looking it up in http://linux.die.net/man/1/bash it says "<< –  Jul 15 '15 at 20:17

1 Answers1

4

From man bash:

Here Strings

A variant of here documents, the format is:

  <<<word

The word is expanded and supplied to the command on its standard input.

Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
MichalH
  • 1,062
  • 9
  • 20
  • thanks, I Although Here-Document knew, I did not know the existence of the Here-String. – higr Jul 16 '15 at 05:43