Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Depends on how complex the expected operations are. I think awk is absolutely essential for dealing with things like logfiles. Do you have a reason against using sqlite[1]? That works just fine in the console, doesn't need a server. You could still use awk with it, technically. For example:

    bash..$ sqlite3 books.sqlite
    sqlite$ create table books ( title varchar(128), author varchar(128) );
    sqlite$ insert into books (title, author) values ("Snow Crash", "Neal Stephenson");
    sqlite$ .quit
    bash..$ echo "select * from books;" | sqlite3 books.sqlite
    Snow Crash|Neal Stephenson
[1] http://sqlite.org/


You don't even need to pipe the command in; just put it as the second argument after the database file.

    $ sqlite3 books.sqlite "select * from books"


Thanks for the tip




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

Search: