fork download
  1. #!/bin/bash
  2. s='+---------+------------------------------------------------------+
  3. | Key | Value |
  4. +---------+------------------------------------------------------+
  5. | Address | longstringofcharacters |
  6. +---------+------------------------------------------------------+
  7. | Name | word1-word2-word3 |
  8. +---------+------------------------------------------------------+'
  9. grep -oP '^\h*\|\h*Name\h*\|\h*\K\S+' <<< "$s"
Success #stdin #stdout 0.01s 5576KB
stdin
Standard input is empty
stdout
word1-word2-word3