Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

How to write bash shell script for mentioned requirement?

Shell Programming and Scripting


Closed    
 
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 10: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: 26 September 2016, 4:44 AM EDT
Location: Éire
Posts: 917
Thanks: 25
Thanked 217 Times in 211 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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 05:16 PM
How to write script in bash. alobi Homework & Coursework Questions 2 08-02-2010 06:44 AM
Can anybody write this bash script ? Cecko Shell Programming and Scripting 7 01-16-2009 11:41 AM
Required Shell script for My requirement ntgobinath Shell Programming and Scripting 3 05-01-2008 05:00 PM



All times are GMT -4. The time now is 04:42 AM.