How to write bash shell script for mentioned requirement? | Unix Linux Forums | Shell Programming and Scripting

  Unix/Linux Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

How to write bash shell script for mentioned requirement?

Shell Programming and Scripting


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 12-05-2012
Vineeta Nigam Vineeta Nigam is offline
Registered User
 
Join Date: Nov 2012
Last Activity: 9 December 2012, 3:52 PM EST
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Signal How to write bash shell script for mentioned requirement?

Hi All,

I am unable to write the script for the below requirement.

Requirement:
Main table dir_ancillary table contain three column "dir_ancillary.table_name"," dir_ancillary.text_file_name ", "dir_ancillary.Include" .
This dir_ancillary contain undefined tables in the column "dir_ancillary.table_name".

I need to write the script like the way- IF "dir_ancillary.Include" column contain 'Y' value for "dir_ancillary.table_name" then I need to unload all of the data for that dir_ancillary.table_name to a file name that is contained in dir_ancillary.text_file_name and include it in the Ancillary.zip file .


Please let me know how could it posibble to make it by Unix script becaue we have unlimited (not defined) tables in table_name column. It is dynamic .it could be 10 or 30,50 , 90. any number.


Please reply me.

Thanks Unix team for helping me.

Last edited by Corona688; 12-05-2012 at 11:34 AM..
Sponsored Links
    #2  
Old Unix and Linux 12-05-2012
Skrynesaver's Unix or Linux Image
Skrynesaver Skrynesaver is offline Forum Advisor  
Grumpy old geek
 
Join Date: Mar 2011
Last Activity: 4 March 2015, 2:11 PM EST
Location: Éire
Posts: 861
Thanks: 21
Thanked 201 Times in 197 Posts
Which DB are the tables in and what CLI client do you use?

Is that client scriptable ?

The actual command will look something like

Code:
 
for i in $(db_client_select_column) 
  do 
  if [ $i ==  "Y" ]
    then db_dump_table_command
  fi
done

Sponsored Links
    #3  
Old Unix and Linux 12-05-2012
Vineeta Nigam Vineeta Nigam is offline
Registered User
 
Join Date: Nov 2012
Last Activity: 9 December 2012, 3:52 PM EST
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Hi ,

Database is Informix database. sorry I didn't get CLI client. What is this ? Sorry I am new for Unix . I have to write the script to get the data from Informix database to Unix server.
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to write a script for the below mentioned issue rajkumar_g Shell Programming and Scripting 0 10-07-2010 06:16 PM
How to write script in bash. alobi Homework & Coursework Questions 2 08-02-2010 07:44 AM
Can anybody write this bash script ? Cecko Shell Programming and Scripting 7 01-16-2009 12:41 PM
Required Shell script for My requirement ntgobinath Shell Programming and Scripting 3 05-01-2008 06:00 PM



All times are GMT -4. The time now is 10:33 PM.