on 2015 Jan 22 2:47 PM
I'm moving my production environment from Windows to Linux.
A shell script will be used to perform meta-data changes.
BUT
My DBA password has a single quote (') and an exclamation mark (!) in it.
And for the live of me, I can't get my shell script to connect.
Example. Say may password is
I,haven'tAnIdea!
I've tried escape characters:
dbisql -c "UID=DBA;PWD=I,haven\\'tAnIdea!;Server=pw02;ASTART=No"
I've tried placing my connection string in a file, with- , and without escape characters.
dbisql @connection.ini
I know the simplest would be to change my password. But that doesn't solve what has now become an obsession to solve!
Request clarification before answering.
There seems to be 2 layers of parsing you need to escape for. Quadruple up those "'" chars
My test with granting a password of
grant connect to ... Identified by 'abc''def'
I found I needed to submit the password as
"...;PWD=abc''''def;..."
HTH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I wrote an "argv" app in C a very long time ago that displays the command line arguments that are passed on to "main" using a variety of methods (argc/argv, Windows GetCommandLine and GetCommandLineW, etc.). This handy tool lets you see how command-line arguments are massaged by your shell and the C run-time. Very, very useful in cases like this when you need to understand just what the application is actually seeing.
User | Count |
---|---|
64 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.