News for hackers. Stuff that matters.
Re:Webserver in bash (2007) by frewsxcv on Friday August 16, 2013 @01:28AM (#6222334)
Hardly implemented in Bash, it uses nc. I have a friend who implemented using no external binaries in Bash. I'll ask him and see if I can get it

EDIT: I think this is it: http://ur1.ca/f2ozi

Re:Webserver in bash (2007) by M4v3R on Friday August 16, 2013 @02:31AM (#6222486)
It is a convention that when you say "written in bash" it means "using bash language and standard *nix binaries". Bash alone can't do anything, nearly every keyword in it is actually a binary, including "echo", "true" and "false" or "[" used in if statements, which you can usually find in /bin or /usr/bin. You couln't write simplest bash scripts without using any binaries.

Netcat (nc) is built in to nearly every system that has bash. Wget and Curl on the other hand, are not.

Re:Webserver in bash (2007) by krunaldo on Friday August 16, 2013 @03:32AM (#6222652)
Wrong!

echo, true, false and [ are builtins in bash and are in the binary. You can even do TCP/UDP through bash by using the pretend redirect files /dev/(tcp|udp)/$host/$port.

curl or wget exists on most systems by default in a minimal installation now days, nc does not, but if you run a normal installation you will get it though.

Re:Webserver in bash (2007) by JosephRedfern on Friday August 16, 2013 @07:17AM (#6223281)

   josephredfern@ubuntu:~$ which [
   /usr/bin/[
Re:Webserver in bash (2007) by Daviey on Friday August 16, 2013 @08:34AM (#6223567)
Use 'type', not 'which'
Re:Webserver in bash (2007) by LukeShu on Friday August 16, 2013 @04:17PM (#6226531)
It exists as both an external program, and as a builtin

    $ type [
    [ is a shell builtin
Re:Webserver in bash (2007) by Daviey on Friday August 16, 2013 @03:47AM (#6222692)
I disagree about those 'keywords' not being part of bash:

$ echo $SHELL

/bin/bash

$ type echo true false [

echo is a shell builtin

true is a shell builtin

false is a shell builtin

[ is a shell builtin

Re:Webserver in bash (2007) by dhamidi on Friday August 16, 2013 @01:44AM (#6222368)
That is a HTTP client written in bash.
Re:Webserver in bash (2007) by D9u on Friday August 16, 2013 @02:28AM (#6222475)
BASH = Bourne Again SHell

You could do the same in zsh, or another compatible shell, using netcat, so while semantics may be on your side, the server does run in a BASH shell.

I was under the impression that wget, curl, etc, are external binaries and not built in to the BASH shell.

Re:Webserver in bash (2007) by president on Friday August 16, 2013 @02:14AM (#6222442)
That uses wget, curl, lynx...
Re:Webserver in bash (2007) by GregorStocks on Friday August 16, 2013 @02:23AM (#6222464)
It looks like it'd work fine without them, it just uses them if they're available (presumably they're more efficient/reliable than using straight bash)