[Lazarus] Handy script for Firebird users
Henry Vermaak
henry.vermaak at gmail.com
Wed Apr 30 13:32:58 CEST 2008
2008/4/30 Graeme Geldenhuys <graemeg.lists at gmail.com>:
> Joost van der Sluis wrote:
> > And you didn't write it in Pascal because.... ?
> >
> > Joost
>
> Because the deployment PC's will not have FPC on them.
> Ummm... Then again, it takes all the parameters it needs for
> customization. Also, if I make it a console app, it will be
> cross-platform to. :)
>
> How to you handle standard input like was done in the script?
>
> ------------copy-------------
>
> echo -n "Creating the database $database ..."
> ${ISQL} << EOF
> set sql dialect 3;
> CREATE DATABASE "$database";
> commit;
> EOF
> if [ ! $? = 0 ]; then
> echo "Failed."
> else
> echo "Done."
> fi
> ------------end-------------
it's just feeding the sql program a string (heredoc), then checking
the result. you don't need to do anything special to transcribe this
to pascal :)
henry
More information about the Lazarus
mailing list