Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Sybase > isql output file...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-25-07, 23:47
ftmjr ftmjr is offline
Registered User
 
Join Date: Mar 2007
Posts: 157
isql output file...

I'm currently using the below syntax to prevent the password being displayed via "ps".

isql -Smyserver -Umylogin <<EOF
$PASSWORD
EOF

The challange is... the isql output file for some reason contains the string "Password:". For example...

-----------------------------------------------------------------------------------
Password:
The class column will display the cursor name for locks associated with a cursor for the current user and the cursor id for other users.
fid spid loid locktype table_id page row dbname class context

------ ------ ----------- ---------------------------- ----------- ----------- ------ --------------- ------------------------------ ------------------
----------
0 268 536 Sh_intent 688002451 0 0 master Non Cursor Lock

(return status = 0)
-----------------------------------------------------------------------------------

How do I get rid of the "Password:"? Sorry if this is a basic question. I've tried everything I know, but have not been successful in getting rid of the "Password:" string in my isql output file.

Thank you.
Reply With Quote
  #2 (permalink)  
Old 11-26-07, 12:13
trvishi trvishi is offline
Registered User
 
Join Date: Sep 2003
Location: Switzerland
Posts: 371
Use -Ppassword OR use -P`cat filename` in the command line.
Reply With Quote
  #3 (permalink)  
Old 11-26-07, 21:04
ftmjr ftmjr is offline
Registered User
 
Join Date: Mar 2007
Posts: 157
Will the password be displayed in "ps" if I use -P ?

Will the password be displayed in "ps" if I use -P ? For example...

isql -Smyserver -Umylogin <<EOF
-P$PASSWORD
EOF
Reply With Quote
  #4 (permalink)  
Old 11-27-07, 03:36
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 830
isql -Smyserver -Umylogin -o my.log <<EOF >/dev/null
$(cat ~/.myserver)
select getdate()
go
EOF
more my.log

Can also use -i flag with <<EOF

Using a file to store your password (in e.g. .myserver) allow you to change your password without having to update all your scripts.
Reply With Quote
  #5 (permalink)  
Old 11-27-07, 05:44
ftmjr ftmjr is offline
Registered User
 
Join Date: Mar 2007
Posts: 157
Will this work.... <<EOF -P$PASSWORD EOF

Will the password be displayed in "ps" if I use -P ? For example...

Below is the exact syntax we are using...

isql -S $SERVERNAME -U $LOGINNAME -i $ISQL_INPUT_FILE -w 500 >> $ISQL_OUTPUT_FILE <<EOF
$PASSWORD
EOF

Will the below syntax work? Without displaying the password via "ps"?

Below is the exact syntax we are using...

isql -S $SERVERNAME -U $LOGINNAME -i $ISQL_INPUT_FILE -w 500 >> $ISQL_OUTPUT_FILE <<EOF
-P$PASSWORD
EOF
Reply With Quote
  #6 (permalink)  
Old 11-27-07, 06:39
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 830
Quote:
Originally Posted by ftmjr
Will this work.... <<EOF -P$PASSWORD EOF
No I don't thik so

Last edited by pdreyer : 11-27-07 at 06:43.
Reply With Quote
  #7 (permalink)  
Old 11-27-07, 07:58
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 830
This is the best I can come up with to append to output

isql -S $SERVERNAME -U $LOGINNAME -i $ISQL_INPUT_FILE -w 500 <<EOF | tail +2 >> $ISQL_OUTPUT_FILE
-P$PASSWORD
EOF
Reply With Quote
  #8 (permalink)  
Old 11-27-07, 21:41
ftmjr ftmjr is offline
Registered User
 
Join Date: Mar 2007
Posts: 157
I will give it a spin...

You were right. I tried the below and it did not work...

isql -S $SERVERNAME -U $LOGINNAME -i $ISQL_INPUT_FILE -w 500 >> $ISQL_OUTPUT_FILE <<EOF
-P$PASSWORD
EOF

So we will give your code a spin...

isql -S $SERVERNAME -U $LOGINNAME -i $ISQL_INPUT_FILE -w 500 <<EOF | tail +2 >> $ISQL_OUTPUT_FILE
-P$PASSWORD
EOF

Sincere thanks for your help.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On