ShellSQL – SQL for shell scripts

ShellSQL – SQL for shell scripts
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.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s