Hacker News new | past | comments | ask | show | jobs | submit login

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.




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.


   josephredfern@ubuntu:~$ which [
   /usr/bin/[


Use 'type', not 'which'


It exists as both an external program, and as a builtin

    $ type [
    [ is a shell builtin


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: