News for hackers. Stuff that matters.
Re:Pure Bash Web Server by zamadatix on Friday February 16, 2024 @11:46AM (#39399481)
More nc, cut, grep, head, mkfifo, youtube-dl, and mplayer than anything about Bash.
Re:Pure Bash Web Server by NegativeLatency on Friday February 16, 2024 @11:47AM (#39399509)
If bash is passing and handling input from an http request that’s pretty much good enough for me.
Re:Pure Bash Web Server by zamadatix on Friday February 16, 2024 @11:51AM (#39399564)
It's not really doing that though. Nc+head/cut/grep are and youtube-dl is grabbing the data. Bash in this case is just orchestrating the order of communication between the tools doing the actual work, as a normal Bash script.

The post is about doing all of this in pure bash builtins like /dev/tcp and bash functions. Not about gluing together tools which do the work.

Re:Pure Bash Web Server by gtroja on Friday February 16, 2024 @12:01PM (#39399716)
Nonetheless pretty wicked app made with bash
Re:Pure Bash Web Server by zamadatix on Friday February 16, 2024 @12:08PM (#39399829)
Yeah, it's a nifty little tool. On the other hand when a really interesting post on pure bash exposition comes up the comments section turns to talking about plain bash scripts they've made or know of instead. There are several normal scripts replied in this post and a few others via links, more than actual conversation around what the post is actually about (so far). That's all I was commenting on, not the value of the tool. It's a hill :).
Re:Pure Bash Web Server by QuadmasterXLII on Friday February 16, 2024 @01:12PM (#39400794)
your hill is valid, sorry
Re:Pure Bash Web Server by stonekyx on Friday February 16, 2024 @07:53PM (#39405113)
Even the post isn't using /dev/tcp, but compiled a C file into bash "loadable builtin" (which is something I learned today). It still feels kind of cheating to me tbh.. But cool enough!
Re:Pure Bash Web Server by zamadatix on Friday February 16, 2024 @08:34PM (#39405425)
It is a bit of a cheat, to be fair. Official bash loadable module, but not necessarily a part of the static bash binary.
Re:Pure Bash Web Server by remram on Friday February 16, 2024 @05:16PM (#39403695)
That's not the rules used in this submission though.

> A purely bash web server, no socat, netcat, etc...

Re:Pure Bash Web Server by agumonkey on Friday February 16, 2024 @12:14PM (#39399912)
as always
Re:Pure Bash Web Server by samatman on Friday February 16, 2024 @07:37PM (#39404980)
Yeah that's how bash scripting works.
Re:Pure Bash Web Server by zamadatix on Friday February 16, 2024 @08:18PM (#39405323)
See the original GitHub post for how this post is not about scripting other binaries with Bash but pure Bash implementations of functionality. The posted script e.g. does not call nc or grep to make the socket or process the text. What makes this post interesting and upvoted is that it's esoteric.

It's like replying to a thread about implementing a web server in C macros with how you implemented a music jukebox as a standard C program. Great, but also not the point or really even related.