A Bash web server

With one line of Bash code, you can create a Bash web server for quickly viewing the output from Bash scripts and commands.

For people who do a lot of work with command-line tools or Bash code, having a Bash web server could be very handy. I was really amazed that in one line of Bash code I was able to create web servers that could:

  • Send the output from a Bash command directly to a browser page
  • Create diagnostic pages using standard Linux tools
  • Create pages that view Raspberry PI GPIO pins
  • Create a page to toggle a Rasp PI GPIO pin

One-Line Web Servers

While a number of minimal, one-line web servers exist in most programming languages [1], you can create a Bash web server using the networking utility nc (or netcat) as follows:

[…]

Use Express-Checkout link below to read the full article (PDF).

Posted by Contributor