Operating System - HP-UX
1833198 Members
2731 Online
110051 Solutions
New Discussion

passing password to isql in a shell script

 
mohanx
New Member

passing password to isql in a shell script

am using isql with -i option to execute a query.this is in a shell script. i want to know the various options of passing the password keeping in mind the issue of other users not able to "see" the password.
3 REPLIES 3
harry d brown jr
Honored Contributor

Re: passing password to isql in a shell script

Write a "c" program to start it, embed the passwd - encrypted, and when you execute the program decrypt it and pass it to isql.

live free or die
harry
Live Free or Die
Deepak Extross
Honored Contributor

Re: passing password to isql in a shell script

Why do you need to pass a password to isql?
The following query should work:
isql -s database_name << EOF

EOF

As long as the user-id of the person running this query has appropriate permissions on the database, no password should be necessary.
James Beamish-White
Trusted Contributor

Re: passing password to isql in a shell script

There is also a tool out there called Expect. It responds to 'expected' prompts with whatever you want it to. Have a search on the web for it.

Cheers,
James
GARDENOFEDEN> create light