TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Writing a Language Server in Bash

1 pointsby tpetrover 1 year ago

1 comment

mdanielover 1 year ago
<p><pre><code> # Capture the content-length header value [[ &quot;$line&quot; =~ ^Content-Length:\ ([0-9]+) ]] </code></pre> Be forewarned that the space after any http header is optional &lt;<a href="https:&#x2F;&#x2F;www.rfc-editor.org&#x2F;rfc&#x2F;rfc9112#name-field-syntax" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.rfc-editor.org&#x2F;rfc&#x2F;rfc9112#name-field-syntax</a>&gt; so require it in your match at your peril. And, of course, http headers are case insenstiive so checking for the upper in <i>any</i> position is rolling the dice<p><pre><code> id=$(echo -E &quot;$json_payload&quot; | jq -r &#x27;.id&#x27;) </code></pre> that answers my question about how &quot;in Bash&quot; was going to deal with all the json