4 ms·
Need to be clear that "full http server in pure bash" is incorrect. Bash cannot listen on a TCP/UDP socket for incoming connections. bash-web-server project bu
by iam-TJ 4mo ago
Need to be clear that "full http server in pure bash" is incorrect. Bash cannot listen on a TCP/UDP socket for incoming connections.
bash-web-server project builds a C language socket listener [0] that is dynamically loaded at run-time as a "built-in" module that makes the functionality available.
[0] https://github.com/bahamas10/bash-web-server/tree/main/loadables https://github.com/bahamas10/bash-web-server/tree/main/loada...
- majorchord 4mo agoBy this logic, Linux does not support Wi-Fi, because all the driver modules are "dynamically loaded at run-time."
- zwischenzug 4mo agoPure Linux doesn't.
- pastage 4mo agoInteresting. I have never heard kernel modules being regarded as non-linux, not in 30 years of LKM. Further compiling a monolithic Kernel is rather straight forward, in this day it is even possible to find wifi devices that do not require a an on device firmware blob uploaded from the kernel.
- zwischenzug 4mo agoI don't know TBH. It's just that if you're going to have a 'pure' designation for a tech, it's going to be pretty strict (as per bash and adding modules). I've never heard of 'pure' linux, but 'pure' bash has a recognised meaning. If someone said 'pure Linux' and it meant the core without loaded modules I wouldn't be shocked. Not sure how useful it would be, though.
- rascul 4mo ago> If someone said 'pure Linux' and it meant the core without loaded modules I wouldn't be shocked. Not sure how useful it would be, though. That probably wouldn't be a useful distinction because almost every module can be built in
- majorchord 4mo agoSame, this whole thread is like the twilight zone for me... I can't tell if I'm losing my mind or all the people with this way of thinking are just being completely unreasonable but I've never seen several people at once agree with such a ridiculous (to me) comment. Reminds me of the time on libera IRC when someone told me "cloud storage does not exist" because they were hung up on some ultra-purist word definition that nobody else shared.
- Brian_K_White 4mo agoCorrect. It doesn't.
- ranger_danger 4mo ago[dead]
- account42 4mo agoNo, by any other logic you can implement your Wi-Fi drivers in bash.
- mrspuratic 4mo agoThis feature has been part of bash since 5.1 (ca 2020), though it may not be enabled in all distros. cd src/bash-5.3/examples/loadables make accept enable -f ./accept accept (accept -r RHOST -v SOCKETFD -b 127.0.0.1 8000; read -u $SOCKETFD SOCKETDATA; printf "%s: %s\n" "$RHOST" "$SOCKETDATA"; printf "goodbye, world\n" 1>&${SOCKETFD} ) & nc 127.0.0.1 8000 <<< "hello, world" For real use you may need to add "exec {SOCKETFD}<&-" to close the FD. Edit: https://news.ycombinator.com/item?id=39369749 https://news.ycombinator.com/item?id=39369749 (2024)