SOCI / soci

Official repository of the SOCI - The C++ Database Access Library
http://soci.sourceforge.net/
Boost Software License 1.0
1.37k stars 472 forks source link

How to escape a "!" present in connection string ? #1006

Closed mreis1 closed 1 year ago

mreis1 commented 1 year ago

./soci_firebird_test "service=localhost:DB_ALIAS user=SYSDBA password=masterkey!2" will output bash: !2: event not found because my password has a exclamation mark.

How is it suppose to escape it? Tried wrapping the value in quotes but had no luck. ./soci_firebird_test "service=localhost:DB_ALIAS user=SYSDBA password=\"masterkey!2\""

Any suggestions? Thank you

zann1x commented 1 year ago

! is part of bash's history expansion. Enclosing the whole connection string in single quotes instead of double quotes or turning off history expansion in your shell should fix the problem.

vadz commented 1 year ago

This is a shell question, not a SOCI question, but the answer is to use single quotes around the connection string.