How to authenticate sybase login thru shell script ?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to authenticate sybase login thru shell script ?
# 1  
Old 12-01-2008
How to authenticate sybase login thru shell script ?

Hi All,

This is my first post. Need your favour guys.

I need to authenticate syabse login/password thru shell script.
I am getting the ID & Pwd form user and storing it in variable..
But how to authenticate and echo user back if the id/pwd doesnt work.

isql -U$1 -P$2 -S$3 ??

thanks in advance..

Cheers,
David.
# 2  
Old 12-05-2008
Hi David,

What specifically is the problem? Are you trying to write a script to do some sql, or are you trying to create an easier way for interactive logins?
# 3  
Old 12-07-2008
Quote:
Originally Posted by otheus
Hi David,

What specifically is the problem? Are you trying to write a script to do some sql, or are you trying to create an easier way for interactive logins?
Hi there, thanks for the reply.

I am writing a script to extract some data (some code numbers) from sybase and then decode them using script. Before running my query i ant to make sure the guy typed in the correct id/pwd combinaion..

This is what I am looking for.. Thanks.
# 4  
Old 12-09-2008
Here is an example in bash.
Code:
let success=0
until $success; do 
    stty -echo
    read -s -p "Enter Sybase password for '$1' > " password
    mysql-command $1 $password
    let success=$?
done

A non-bash solution is pretty simple, but can create confusion if you interrupt the process.

Code:
let success=0
while [ $success = 0 ]; do 
    echo -n "Enter Sybase password for '$1' > " 
    stty -echo </dev/tty
    read password </dev/tty
    stty sane
    mysql-command $1 $password
    let success=$?
done

Type "stty sane" if you interrupt (CTRL-C) the read command. Otherwise, you won't be able to see what you typed
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Proxy Server

Solaris 11.1 login authenticate with windows active directory

Hi, is that possible to login to solaris 11.1 authenticate with windows active directory? the user id is created in the windows active directory. Environment: Solaris 11.1 Windows 2012 Active Directory (3 Replies)
Discussion started by: freshmeat
3 Replies

2. Shell Programming and Scripting

Extract top 20 records from sybase db in shell script

Hi, I am new to advanced scripting. I need to get top 20 records from database (Sybase) with a condition that all Char/varchar columns should have more than 4 characters. I need to do this via shell scripting, I have got half logic (on how to get varchar/char columns and stored it in a... (2 Replies)
Discussion started by: Selva_2507
2 Replies

3. Shell Programming and Scripting

Sybase connection failing through shell script

Hi All, I'm trying to connect to Sybase via shell script. i'm getting the following error. Please let me know where i'm going wrong. Note that i'm not having this issue when connecting via terminal. #!/usr/bin/bash SYBASE=/usr/sybase ISQL=$SYBASE/bin/isql export SYBASE ISQL ... (6 Replies)
Discussion started by: Irishboy24
6 Replies

4. Solaris

Sybase Connectivity Check through Shell Script

Hi, I need to check the sysbase database connectivity through the Unix Shell Script. Can you help me on the how to write the script to test the sysbase database connection. Thanks in Advance Nandha (0 Replies)
Discussion started by: nandha2387
0 Replies

5. UNIX for Advanced & Expert Users

Telnet from shell script , further need to logout if log in not authenticate

Using unix shell script file I need to telnet to a IP further send a command to the telnet IP and get the response to a file with out using "expect" utility and I have achieved this by below command. (sleep 3; echo admin; sleep 3; echo mypass; sleep 5;echo "show status-list"; sleep 5; echo... (3 Replies)
Discussion started by: raghunath Rao
3 Replies

6. Shell Programming and Scripting

Capturing Sybase SP output in Shell Script

Greetings, I need to capture the output of a Sybase stored procedure, inside my shell script( k shell). Based on this output, I need to call another perl script, with input arguments as the result set of the procedure execution. I need to keep looping through and call the perl script, ... (2 Replies)
Discussion started by: rajpreetsidhu
2 Replies

7. Shell Programming and Scripting

Authenticate Shell script

Hi I want to create a script that will authenticate user from a file and if both of them match then only the script is allowed to be executed... Suppose I have a script say test.sh and a file config.txt for users whose user ids exist in the text file should only be given permission to... (1 Reply)
Discussion started by: ultimatix
1 Replies

8. UNIX for Dummies Questions & Answers

sybase connection through shell-script

:mad: how do i connect to sybase through shell script written in linux (9 Replies)
Discussion started by: Amitabh
9 Replies

9. Shell Programming and Scripting

? Authenticate Sybase login thru script ?

Hi All, This is my first post. Need your favour guys. I need to authenticate syabse login/password thru shell script. I am getting the ID & Pwd form user and storing it in variable.. But how to authenticate and echo user back if the id/pwd doesnt work. isql -U$1 -P$2 -S$3 ?? ... (1 Reply)
Discussion started by: libin4u2000
1 Replies

10. Shell Programming and Scripting

Connecting to sybase via shell script.

Hi All, I was able to connect to sybase in shell script and also able to run few sql queries, something like this, #!/usr/bin/ksh -x temp=`echo "select name from sysobjects where type = 'U'"` results=`isql -SDS_SERVER-UAdhocUser -Pha12 <<EOF set rowcount 6 $temp go EOF` line_count=0... (1 Reply)
Discussion started by: arvindcgi
1 Replies
Login or Register to Ask a Question