I'm currently working on a small backup of a script from some firebird databases, and I am having a weird escaping problem that I seem to be unable to solve. Here the thing in my script is creating the sqlog variable into which I would like to put the output of the command chain, here it is.
sqllog=`echo "SELECT * FROM RDB\$DATABASE;" | isql -u SYSDBA -pass mypasswd localhost:mydatabase | tail -n 2 | head -n 1 | wc -l`
If I try to execute this in a shell, I get the following error
Statement failed, SQLCODE = -204
Dynamic SQL Error
-SQL error code = -204
-Table unknown
-RDB
-At line 1, column 15.
An unknown RDB table means my attempt to escape $.
thanks for any help :)
source
share