bash select vs SQL select

I needed to pull some info from a mysql DB and I ssh to the remote box and do

$ select * from foo where foo=bar; 

and I get the following error

bash: syntax error near unexpected token `from'

I break my head for 10 min trying to figure out what the heck was going wrong and then I realise I was still on the bash shell and never used the mysql client to login to the DB. I never realised there was a command line version of the select syscall. I think I should go sleep now.

12 Comments

  1. kingsly · June 10, 2004 Reply

    Aren’t you glad there is no “delete” command/built-in ?

  2. mannu · June 11, 2004 Reply

    I’ve confused telnet and ftp in my sleep. I mean when I’m still at the keyboard when I should be sleeping.

  3. kewldeaf · June 11, 2004 Reply

    That user Picture of yours really rocks !

    VIM rules AFAIK.

  4. louiswu · June 11, 2004 Reply

    bluesmoon · June 11, 2004 Reply

    then there’s the join, merge, split, cut, sort and uniq commands that pretty much do SQL in the shell.

  5. achitnis · June 11, 2004 Reply

    Real programmers do

    $ cat > a.out
  6. anomalizer · June 11, 2004 Reply

    Kallu aint even a fake programmer, let alone real

  7. admin · June 11, 2004 Reply

    and hence I boot to windows and open Notepad and File -> Open -> foo.c

  8. achitnis · June 11, 2004 Reply

    and then complain about “how do you start Visual-gcc”?

  9. louiswu · June 11, 2004 Reply

    Visual-gcc is for lamers. gcc.NET 0wnZ. 😀

  10. achitnis · June 11, 2004 Reply

    > Visual-gcc is for lamers

    Precisely.

  11. lihkin · June 12, 2004 Reply

    Real programmers do:

    $ zcat > a.out

    or even:

    $ bzcat > a.out

    or even:

    $ cat /dev/urandom > a.out (Please setup RNG accordingly :P)

    Heh. Warm memories from /.

Leave a Reply