ShellSQL - SQL for shell scripts

Posted on September 16, 2008 in General News

ShellSQL is a suite of programs designed to enable LINUX/UNIX shell scripts to connect to SQL engines and execute SQL queries and commands in a simple way enabling intergration with the rest of the script. For example, it can do things like..
#/bin/shHANDLE=`shpostgres dbname=mydb`

shsql $HANDLE "begin"

for ARG in $


shsql $HANDLE "insert into mytable fld1, fld2" \

"values nextvalmyseq, $ARG"


shsql $HANDLE "commit"

if [ $# -gt 0 ]


ROWS=`shsql $HANDLE "select count from mytable"`

echo "No of rows now in table is" $ROWS


shsqlend $HANDLE

For details on how it hangs together have a look at the overview.