title: POSIX shell compliant method to find matching line with HTML element by name, then extract HTML element value
body: <p>POSIX shell compliant method to find matching line with HTML element by name, then extract HTML element value</p>
  
  <p><strong>Input Data Source</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang='en'&gt;
  
  &lt;head&gt;
    &lt;meta charset='utf-8'&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;main&gt;
      &lt;div class='wrapper'&gt;
          &lt;div class='float1'&gt;
            &lt;form id="form1" action="/endpoint" method="post"&gt;
              &lt;input name="input1" type="hidden" value="value1" /&gt;
              &lt;fieldset&gt;
                &lt;input id="input2" name="input2" value="value2"&gt;
                &lt;input id="input3" name="input3" value="value3"&gt;
              &lt;/fieldset&gt;
            &lt;/form&gt;
          &lt;/div&gt;
        &lt;/div&gt;
    &lt;/main&gt;
  
    &lt;footer&gt;
    &lt;/footer&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Output required</strong></p>
  
  <pre><code>value1
  value2
  value3
  </code></pre>
  
  <p><strong>Logic required</strong></p>
  
  <ol>
  <li>Find input element with name equal to "input1"</li>
  <li>For this element, extract value contents</li>
  </ol>
  
  <p><strong>Preferences</strong></p>
  
  <ul>
  <li>SED or AWK would be preferred answer. Unsure of any other POSIX compliant method which could parse HTML.</li>
  <li>Command would should be reusable, so multiple Shell variables can use the same command (with a different element name)</li>
  </ul>