Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content 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 us.

shell script

This is a discussion on shell script within the Unix/Linux forums, part of the Operating Systems category; anyone please suggest me tutorial for database connectivity in unix shell scripts? i think we can use the same commands we run in the shell prompt. is it?...

Go Back   Geeks Talk > Operating Systems > Unix/Linux
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 02-21-2007
Expert Member
 
Join Date: Dec 2006
Location: Chennai
Posts: 203
Thanks: 2
Thanked 17 Times in 15 Posts
Barbie is on a distinguished road
shell script

anyone please suggest me tutorial for database connectivity in unix shell scripts?
i think we can use the same commands we run in the shell prompt. is it?
Reply With Quote
The Following User Says Thank You to Barbie For This Useful Post:
Sponsored Links
  #2 (permalink)  
Old 02-22-2007
Junior Member
 
Join Date: Feb 2007
Location: India
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
shal_rajj is on a distinguished road
Re: shell script

Thanks Barbie for asking this query.

I too wanted to get to know about this.
Reply With Quote
  #3 (permalink)  
Old 02-22-2007
Expert Member
 
Join Date: Dec 2006
Location: Chennai
Posts: 203
Thanks: 2
Thanked 17 Times in 15 Posts
Barbie is on a distinguished road
Re: shell script

Hi shal raji,
i learnt about it.
there is no special syntax to do this.
just connect to database using "sqlplus" as u will do in shell prompt and go on with ur sql queries. thats it.

but i don know any link to learn about this. if i get to know any link, i will it post here.
Reply With Quote
  #4 (permalink)  
Old 07-26-2008
Junior Member
 
Join Date: Jul 2008
Location: india
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
vishalcjha is on a distinguished road
Re: shell script

there is no special command for data base connectivity
i use informix database with unix
i write all informix command in a shell
and if executed with authentication to data base the result is same
i am able to mix normal scripting command with database command
i enables me do write database related cron very easily
Reply With Quote
  #5 (permalink)  
Old 08-13-2008
Junior Member
 
Join Date: Aug 2008
Location: Banglore
Posts: 4
Thanks: 0
Thanked 2 Times in 2 Posts
meeluch is on a distinguished road
Re: shell script

isql -s$servername -u$username -p$password this is the syntax i think...
Reply With Quote
The Following User Says Thank You to meeluch For This Useful Post:
  #6 (permalink)  
Old 08-14-2008
Junior Member
 
Join Date: Aug 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
deepak_birole is on a distinguished road
Re: shell script

Quote:
Originally Posted by Barbie View Post
anyone please suggest me tutorial for database connectivity in unix shell scripts?
i think we can use the same commands we run in the shell prompt. is it?
yes u can use the same commands that u use in shell. But u have to set oracle's environment variables in the script.
Reply With Quote
  #7 (permalink)  
Old 08-20-2008
Junior Member
 
Join Date: Aug 2008
Location: Banglore
Posts: 4
Thanks: 0
Thanked 2 Times in 2 Posts
meeluch is on a distinguished road
Re: shell script

ls –l|grep –v ‘..\.’ what is themeaning of this command
Reply With Quote
  #8 (permalink)  
Old 08-20-2008
Junior Member
 
Join Date: Aug 2008
Location: Kolkata
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
asutoshc is on a distinguished road
Re: shell script

This expression filters out all the files listed out by the commands 'ls -l' and the removes the files having names containing the DOT (.) character.
grep is for pattern matching. grep with '-v' takes out only those which don't match that pattern. In the pattern. '\.' refers to the dot character. The other dots refer to any one or more occurance of the said character.
Pl note that apparently it may lists out the directoies (because directory names have no dot usually), but it is not. You get the same result for '.\.' also.
Hope you have got the answer.
Reply With Quote
  #9 (permalink)  
Old 08-24-2008
Junior Member
 
Join Date: Mar 2006
Location: Noida
Posts: 13
Thanks: 1
Thanked 4 Times in 3 Posts
tagro82 is on a distinguished road
Re: shell script

Just write a shell script:- sample posted below
result=`sqlplus -s har/har < set feedback off
set heading off
set verify off
select count(*) from table.abc@cinder;
commit;
exit
eof!`
Reply With Quote
  #10 (permalink)  
Old 08-28-2008
Junior Member
 
Join Date: Aug 2008
Location: India Pune
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
mahule_n is on a distinguished road
Re: shell script

isql
An interactive command-line shell that allows executing SQL statements

isql -S -U -P -c -w 20000000000 use

Example:
isql –SNYP_LASER1 -Umacigrab -Pmacigrab -c -w 20000000000 use dbloan
1> SELECT COUNT(*) FROM agreements
2>

-----------
363

(1 row affected)
1> SELECT MAX(agreement_id) FROM agreements
2>

-----------
365

(1 row affected)
1> exit
Reply With Quote
  #11 (permalink)  
Old 08-28-2008
Junior Member
 
Join Date: Aug 2008
Location: India Pune
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
mahule_n is on a distinguished road
Talking Re: shell script

isql
An interactive command-line shell that allows executing SQL statements

isql -S -U -P -c -w 20000000000 use

Example:
isql –SNYP_LASER1 -Umacigrab -Pmacigrab -c -w 20000000000 use dbloan
1> SELECT COUNT(*) FROM agreements
2>

-----------
363

(1 row affected)
1> SELECT MAX(agreement_id) FROM agreements
2>

-----------
365

(1 row affected)
1> exit


See if this works...since it has worked for me but again it quite customized utility provided.....
Reply With Quote
  #12 (permalink)  
Old 09-07-2008
Junior Member
 
Join Date: Sep 2008
Location: india,west bengal,kolkata
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
saheena_08 is on a distinguished road
Re: shell script

i cannot understand the following shellscript,i will be thankfull if tell me the answer.

write a shell script that receive a login name interactively and display the details of the users on the display screen in an easily understandamle format
Reply With Quote
  #13 (permalink)  
Old 09-15-2008
Junior Member
 
Join Date: May 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
mohanty.amitabh is on a distinguished road
Re: shell script

well u can try this
I guess it should work.

==========================================
echo "Enter username : "
read uname
echo "The username entered is $uname"
echo `finger $uname`
==========================================

Let me know if it works.
Reply With Quote
  #14 (permalink)  
Old 10-11-2008
Junior Member
 
Join Date: Oct 2008
Location: india
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
praphulpandit is on a distinguished road
Re: shell script

Quote:
Originally Posted by Barbie View Post
anyone please suggest me tutorial for database connectivity in unix shell scripts?
i think we can use the same commands we run in the shell prompt. is it?
hi, you all about 1)unix shell 2)shell scripting
3)databasefile. othere simple shell scripting to write useing cut,sort,and grep
using.
Reply With Quote
The Following User Says Thank You to praphulpandit For This Useful Post:
Reply

  Geeks Talk > Operating Systems > Unix/Linux

Thread Tools
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

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


Similar Threads

Thread Thread Starter Forum Replies Last Post
QTP - VB script aromalis QTP 7 10-11-2007 11:37 AM
Popular Shell in Linux norman Unix/Linux 1 09-25-2007 08:25 AM
Script Error sharifhere Unix/Linux 2 01-16-2007 07:38 AM
About Shell Layer Management in UNIX nancyphilips Unix/Linux 2 12-14-2006 08:51 AM
Difference in UNIX Shell scott Unix/Linux 2 07-23-2006 12:40 PM


All times are GMT -4. The time now is 12:06 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved